We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word Document variables not accessible in Aspose.words.dokument


I have a word document with document variables. When I load the text in Aspose.Words. The collection doc.variables is empty (Count = 0)

What am I doing wrong.



P.S. Is the problem with ‘Includepicture Mergefield’ solved?


Thanks for your request. There is no any DocumentVariable inside your document. There are Merge Fields. To get a collection of mail merge field names available in the document you should use the following code:

string[] fieldNames = doc.MailMerge.GetFieldNames();

Please see the following information to learn more:


What a problem with Includepicture Mergefield fileds do you mean?

Best regards,

Hello Andrey,

yes there are a lot of mergefileds but a document variable too, the line after 'IMMOPOOL Expose…'

Problem with Includepicture look here:
Extract Mailmergefield from within Includepicture

<o:p> </o:p>

IMMOPOOL Exposé-Generator-Details




Thanks for your request. It is just a link to Document Variable. Please try using the following code:

Document doc = new Document("C:\\Temp\\yourDoc.doc");

// Add new Document Variable

doc.Variables.Add("DETAIL702-02-Baustein-ExpGen-Checkliste.doc", "ValueOfVariable");

// Get collection

VariableCollection collection = doc.Variables;



Best regards,