Introduced in build 8.7
Description
Sets a list of mergefields to be ignored during processing.C#
<p> public void MergeFieldsToIgnore( string [] mergefields)</p> |
vb.net
<p> Public Sub MergeFieldsToIgnore(mergefields as string())</p> |
Parameters
mergefields
An array of strings containing the names of all the mergefields to be ignored.
Exceptions
NullArgumentException
MergeFieldsToIgnore
will throw this exception if mergefields
is null.
Remarks
This feature is available in OOXML files (DOCX/DOCM) only.The MergeField name must match exactly, including case and options.
Examples
C#
WordTemplate wt = new WordTemplate(); wt.Open( @"c:\templates\Template.docx" ); string [] mergefields = { "DataSet1.MergeField1" , "MergeField2(image)" }; wt.MergeFieldsToIgnore(mergefields); wt.Process(); wt.Save( @"c:\reports\Report.docx" ); |
vb.net
Dim wt As New WordTemplate() wt.Open( "c:\templates\Template.docx" ) Dim mergefields = New String() { "DataSet1.MergeField1" , "MergeField2(image)" }; wt.MergeFieldsToIgnore(mergefields); wt.Process() wt.Save( "c:\reports\Report.docx" ) |