VariableCollectionCount Property

Gets the number of elements contained in the collection.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public int Count { get; }

Property Value

Type: Int32
Examples
Shows how to clear all document variables from a document.
Document doc = new Document(MyDir + "Document.docx");

doc.Variables.Add("doc", "Word processing document");
doc.Variables.Add("docx", "Word processing document");
doc.Variables.Add("txt", "Plain text file");
doc.Variables.Add("bmp", "Image");
doc.Variables.Add("png", "Image");

doc.Variables.Clear();
Console.WriteLine(doc.Variables.Count); // 0
See Also