Hi,
I tried replicating what you are trying to do and I could successfully update the field property as well.
Probably you might have missed a step.
Onec you get the node,
1. update the property by replacing the attribute value,i.e.
foreach (XmlNode node in nodeList)
{
newFormat=String.Format("PAGE \\* {0} \\* MERGEFORMAT", "Arabic")
node.Attributes[0].Value = newFormat;
---
}
2. Update the corresponding run with data you want as field data.
node.SelectSingleNode("w:r[2]//w:t", ns).InnerText = "1";
3. save back the xml document in the package(as part,document.xml)
The word documnet would contain
<<1>>
Does anyone have an update for the above type of problem for Word 2010? The Document property is split over a series of run tags with a begin, separate and end fldChar elements. Is there any best practices to handle something like the Xml below?
Thanks
<w:r> <w:fldChar w:fldCharType="begin" /> </w:r><w:r> <w:instrText xml:space="preserve">DOCPROPERTY MyDocProp \* MERGEFORMAT</w:instrText> </w:r><w:r> <w:fldChar w:fldCharType="separate" /> </w:r><w:r w:rsidR="00A77F89"> <w:t xml:space="preserve">This is</w:t> </w:r> <w:proofErr w:type="spellStart" /> <w:r w:rsidR="00A77F89"> <w:t>MyDocProp</w:t> </w:r> <w:proofErr w:type="spellEnd" /> <w:r w:rsidR="00A77F89"> <w:t xml:space="preserve">Value</w:t> </w:r><w:r> <w:fldChar w:fldCharType="end" /> </w:r>