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

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
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