I want to recover the mergefield "OpenSDKXml, C# "

May 29 2015 4:01 AM
I am using the sdk OpenXML for recovering the mergeField on document word, but the code recovered the body of mergeField
 
if (!string.IsNullOrEmpty(strFieldName))
 { //check if we have a value for this merge field 
  if (values.ContainsKey(strFieldName) && !string.IsNullOrEmpty(values[strFieldName]))
     { 
       objField.Parent.Parent.Parent.ReplaceChild<Paragraph>(new Run(new Text(values[strFieldName])),(Paragraph) objField.Parent.Parent);
     }
 }
 

Answers (1)