public void GetDocumentVariables()
{
//ExStart
//ExFor:Document.Variables
//ExFor:VariableCollection
//ExId:GetDocumentVariables
//ExSummary:Shows how to enumerate over document variables.
Document doc = new Document(MyDir + "Document.doc");
foreach (DictionaryEntry entry in doc.Variables)
{
string name = entry.Key.ToString();
string value = entry.Value.ToString();
// Do something useful.
Console.WriteLine("Name: {0}, Value: {1}", name, value);
}
//ExEnd
}