
## VariableCollection class

A collection of document variables.
To learn more, visit the [Work with Document Properties](https://docs.aspose.com/words/python-net/work-with-document-properties/) documentation article.




### Remarks

Variable names and values are strings.

Variable names are case-insensitive.




### Indexers

| Name | Description |
| --- | --- |
| [``__getitem__(index)``](./__getitem__/#int) | Gets or sets a document variable at the specified index. ``None`` values are not allowed as a right hand side of the assignment and will be replaced by empty string. |

### Properties

| Name | Description |
| --- | --- |
| [count](./count/) | Gets the number of elements contained in the collection. |

### Methods

| Name | Description |
| --- | --- |
|[ add(name, value)](./add/#str_str) | Adds a document variable to the collection. |
|[ clear()](./clear/#default) | Removes all elements from the collection. |
|[ contains(name)](./contains/#str) | Determines whether the collection contains a document variable with the given name. |
|[ get_by_name(name)](./get_by_name/#str) | Gets or a sets a document variable by the case-insensitive name. ``None`` values are not allowed as a right hand side of the assignment and will be replaced by empty string. |
|[ index_of_key(name)](./index_of_key/#str) | Returns the zero-based index of the specified document variable in the collection. |
|[ remove(name)](./remove/#str) | Removes a document variable with the specified name from the collection. |
|[ remove_at(index)](./remove_at/#int) | Removes a document variable at the specified index. |

### See Also

* module [aspose.words](../)

