In the Open XML forum the other day a person was concerned about mail merge main documents they were converting from Word 2003 to Word 2010. The users insert merge fields in these documents that serve as “targets” for writing data into the documents. The software company is updating its tool to use the Open XML file formats to insert the data.

They were encountering a problem when opening the documents in Word 2010 to save them to the new file format. Normally, Word will represent a MERGEFIELD field in Open XML as a “simple field”:
 <w:p w:rsidR="00000000" w:rsidRDefault="001E3B40">
   <w:fldSimple w:instr=" MERGEFIELD FirstName ">
    <w:r><w:rPr><w:noProof/></w:rPr>
     <w:t>«FirstName»</w:t>
    </w:r>
   </w:fldSimple>
  </w:p>

But all these converted documents were saving the MERGE fields as “complex fields”:
<w:p w:rsidR="005569A6" w:rsidRDefault="00D059D7" 
  xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
   <w:r>
     <w:fldChar w:fldCharType="begin" />
   </w:r>
   <w:r>
     <w:instrText xml:space="preserve"> MERGEFIELD  FIRSTNAME </w:instrText>
   </w:r>
   <w:r>
     <w:fldChar w:fldCharType="separate" />
   </w:r>
   <w:r w:rsidR="00721AA7">
     <w:rPr>
       <w:noProof />
     </w:rPr>
     <w:t>«FIRSTNAME»</w:t>
   </w:r>
   <w:r>
     <w:rPr>
       <w:noProof />
     </w:rPr>
     <w:fldChar w:fldCharType="end" />
   </w:r>
</w:p>


You can see the problem…

The question was, why Word 2010 was saving the fields in this manner and how to change the behavior.

It was a “lightbulb” day for me. I suggested turning off the option “Store random number to improve Combine accuracy” – the cause of the w:rsidR attributes – in the Trust Center/Privacy settings. Turned out this solved the problem.

Great! I thought, and left the setting off on my main machine and Word 2013 test machine.

Among other things I’m playing with during the Office 2013 beta is synchronization with SkyDrive and editing in the Web Apps. When I’m working with a new feature, I keep a document open with notes. Today I thought I’d see how things behave if I open the document on both machines AND try to edit it in the Web App environment.

Turns out the Word Web app wouldn’t open the document and the two machines wouldn’t share the same document. In other words, there was no “co-authoring”. The Web app told me why: it wasn’t able to ensure combining the document correctly. I needed to turn that option on again…

So, if you need to work with files that should also support co-authoring you’re going to need to live with the rsidR attributes that litter the Open XML.
Leave a Reply


Network-wide options by YD - Freelance Wordpress Developer