> ## 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 EnvironmentVariables Object

This method adds a new environment variable at the end of the collection.

## Syntax

```vb Visual Basic .NET theme={null}
Function AddNew( _
  Name As String, _
  Type As EnvironmentVariableTypeEnum _
) As EnvironmentVariable
```

```cpp C++ theme={null}
HRESULT AddNew(
  BSTR                         Name,
  EnvironmentVariableTypeEnum  Type,
  IEnvironmentVariable**       Result
);
```

## Parameters

**Name**

\[in] This parameter specifies the name of the environment variable.

**Type**

\[in] This parameter of the [**EnvironmentVariableTypeEnum**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/environmentvariabletypeenum.md) type specifies the type of the environment variable.

**Result**

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

## 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

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

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