> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AddNew Method of the LinksToSections Object

This method adds a new link to a section or section variant at the end of the collection. Please note that you may create links to section variants only for non-invoice Document Definitions. For invoices, only links to sections are supported.

## Syntax

```vb Visual Basic .NET theme={null}
Function AddNew( _
  Section As SectionDefinition, _
  Value As PageRoleEnum, _
  Variant As DataSetTableRecord _
) As LinkToSection
```

```cpp C++ theme={null}
HRESULT AddNew(
  ISectionDefinition*  Section,
  PageRoleEnum         Value,
  IDataSetTableRecord* Variant,
  ILinkToSection**     Result
);
```

## Parameters

**Section**

\[in] This variable refers to the [**SectionDefinition**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/sectiondefinition.md) object that contains the section of a Document Definition. It must not be NULL.

**Value**

\[in] This variable of the [**PageRoleEnum**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pageroleenum.md) type specifies the role of the page in the section.

**Variant**

\[in] This variable refers to the [**DataSetTableRecord**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/datasettablerecord.md) object specifying a record in the "Variants" data set that is storing the section variants. Must be NULL for invoice projects.

**Result**

\[out, retval] A pointer to the [**ILinkToSection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/linktosection.md)**\*** variable that receives the interface pointer for the added link.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## See also

[**LinkToSection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/linktosection.md)
