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?
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
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
// Get collection
VariableCollection collection = doc.Variables;