Demi Z

Hi all,

I've been pulling my hair out with this one. I'm trying to insert some wordML to an open Word 2007 docx file via a VSTO addin. All goes well until I try inserting some WordML that has customXml in it.

If my xml is this:

string xml=

Code Snippet

<w:document xmlns:w=''>



<w:customXml w:uri='' w:element='rel'>


<w:attr w:name='value' w:val='2' />







and I do a-

Code Snippet
currentRange.InsertXml(xml, ref missing);

the string "text" is inserted into my word document at the appropriate location, but the customXml wrapper tags are missing.

Does anybody have any ideas as to why this is

Thank you SO much for reading,


Re: Visual Studio Tools for Office insertXml losing customXml tag

Demi Z

I discovered the problem with this. insertXml takes custom tags, wordML or the flat package schema associated with docx files. I was trying to insert something that was a hybrid between the 2nd and 3rd. Once I wrapped my wordML with the flat package xml it worked fine-