The problem is I've found the snippet to update a custom property and it works, but, the field in document.xml isn't updated and the only way is to open Word 2007 and right-click and select Update Field.
How would one go about updating the actual fields in the word document?
It can get really confusing, especially if the DOCPROPERTY is formatted to be partially bold as you can see below
- <w:fldSimple w:instr="DOCPROPERTY Name \* MERGEFORMAT" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
- <w:r w:rsidR="00936A0C"
w:rsidRPr="00CB0BEE">
- <w:r w:rsidR="00936A0C"
w:rsidRPr="00CB0BEE">
- <w:r w:rsidR="00936A0C"
w:rsidRPr="00CB0BEE">
</w:fldSimple>
If the whole field is bold it is much simpler:
- <w:fldSimple w:instr="DOCPROPERTY Name \* MERGEFORMAT" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
- <w:r w:rsidR="00936A0C"
w:rsidRPr="006010D9">
</w:fldSimple>
I've been able to get to the w:fldSimple node but that's about it:
Dim nodeValue As String = String.Format(" DOCPROPERTY {0} \* MERGEFORMAT ", "Name")
Dim nodeList As XmlNodeList = doc.SelectNodes(String.Format("//w:fldSimple[@w:instr='{0}']", nodeValue), nsManager)
I still haven't managed to update it, can anyone help?