DocumentVariables Property
Returns the collection of variables added to a document or template.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
public VariableCollection Variables { get; }

Property Value

Type: VariableCollection
Shows how to enumerate over document variables.

Document doc = new Document(MyDir + "Document.doc");

foreach (KeyValuePair<string, string> entry in doc.Variables)
    String name = entry.Key;
    String value = entry.Value;

    // Do something useful.
    Console.WriteLine("Name: {0}, Value: {1}", name, value);
See Also