Remove merge fields from output documents
Do we have a method in Aspose.Words that will allow us to remove all code fields from a word document? We want to remove merge field codes from several part of the word document not only at the end of the document. We are using Aspose.Words 4.4.2.0
We currenly use the Update/Unlink methods of the Document object using the Word PIA 2002.
Aspose.Words (?)
Word Iterop 2002
Unlink Method
Field object: Replaces the specified field with its most recent result.
Fields object: Replaces all the fields in the Fields collection with their most recent results.
expression.Unlink
expression Required. An expression that returns a Field or Fields object.
Remarks
When you unlink a field, it’s current result is converted to text or a graphic and can no longer be updated automatically. Note that some fields — such as XE (Index Entry) fields and SEQ (Sequence) fields — cannot be unlinked.
Example
This example unlinks the first field in “Sales.doc.”
Documents("Sales.doc").Fields(1).Unlink
This example updates and unlinks all the fields in the first section in the active document.
With ActiveDocument.Sections(1).Range.Fields
.Update
.Unlink
End With
Pasted from <http://msdn.microsoft.com/en-us/library/aa191947(office.10).aspx>