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

Free Support Forum - aspose.com

Support to docvariable fields

I would like to know the support of aspose for handling docvariblae fields, such to find , to replace, etc…
Thank you very much.

Hi Jptorres,

Thank you for inquiry. Yes, you can achieve this by using Aspose.Words 11.0.0. Please follow up the documentation links for more details.

Programming with Documents
Replace Text in a Table
How to Replace Fields with Static Text

In case of any ambiguity, please let me know.

How can i to search all docvariable in my document ?
I tried to iterate the child node collection, but only i get the Run object and i have to use the method getText();
Another way ?
Thank you


Thanks for your inquiry. I think, you can achieve what you need by using the following code snippet:

NodeCollection fields = doc.GetChildNodes(NodeType.FieldStart, true);
foreach (FieldStart docVar in fields)
    if (docVar.FieldType == FieldType.FieldDocVariable)
        // Write your code here

I hope, this will help.

Best Regards,