Is this correct Open Office XML?
<pre><code>        &lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;
    &lt;?mso-application progid="Word.Document"?&gt;
    &lt;pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"&gt;
        &lt;pkg:part pkg:name="/_rels/.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="512"&gt;
            &lt;pkg:xmlData&gt;
                &lt;Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"&gt;
                    &lt;Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml" /&gt;
                &lt;/Relationships&gt;
            &lt;/pkg:xmlData&gt;
        &lt;/pkg:part&gt;
        &lt;pkg:part pkg:name="/word/_rels/document.xml.rels" pkg:contentType="application/vnd.openxmlformats-package.relationships+xml" pkg:padding="256"&gt;
            &lt;pkg:xmlData&gt;
                &lt;Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"&gt;
                    &lt;Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/image1.png" /&gt;
                &lt;/Relationships&gt;
            &lt;/pkg:xmlData&gt;
        &lt;/pkg:part&gt;
        &lt;pkg:part pkg:name="/word/document.xml" pkg:contentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"&gt;
            &lt;pkg:xmlData&gt;
                &lt;w:document mc:Ignorable="w14 w15 wp14" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"&gt;
                    &lt;w:body&gt;
                        &lt;w:p w:rsidR="00AE3E50" w:rsidRDefault="00DE2072"&gt;
                            &lt;w:r&gt;
                                &lt;w:drawing&gt;
                                    &lt;wp:inline distT="0" distB="0" distL="0" distR="0"&gt;
                                        &lt;wp:extent cx="2194560" cy="1463040" /&gt;
                                        &lt;wp:docPr id="1" name="My Video" /&gt;
                                        &lt;wp:cNvGraphicFramePr&gt;
                                            &lt;a:graphicFrameLocks noChangeAspect="1" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" /&gt;
                                        &lt;/wp:cNvGraphicFramePr&gt;
                                        &lt;a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"&gt;
                                            &lt;a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"&gt;
                                                &lt;pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"&gt;
                                                    &lt;pic:nvPicPr&gt;
                                                        &lt;pic:cNvPr id="1" name="" /&gt;
                                                        &lt;pic:cNvPicPr /&gt;
                                                    &lt;/pic:nvPicPr&gt;
                                                    &lt;pic:blipFill&gt;
                                                        &lt;a:blip r:embed="rId2"&gt;
                                                            &lt;a:extLst&gt;
                                                                &lt;a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"&gt;
                                                                    &lt;a14:useLocalDpi val="0" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" /&gt;
                                                                &lt;/a:ext&gt;
                                                                &lt;a:ext uri="{C809E66F-F1BF-436E-b5F7-EEA9579F0CBA}"&gt;
                                                                    &lt;wp15:webVideoPr embeddedHtml="&amp;lt;iframe width=&amp;quot;800&amp;quot; height=&amp;quot;600&amp;quot; src=&amp;quot;http://www.youtube.com/embed/qk51u8-4uo4&amp;quot; frameborder=&amp;quot;0&amp;quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;" w="800" h="600" xmlns:wp15="http://schemas.microsoft.com/office/word/2012/wordprocessingDrawing" /&gt;
                                                                &lt;/a:ext&gt;
                                                            &lt;/a:extLst&gt;
                                                        &lt;/a:blip&gt;
                                                        &lt;a:stretch&gt;
                                                            &lt;a:fillRect /&gt;
                                                        &lt;/a:stretch&gt;
                                                    &lt;/pic:blipFill&gt;
                                                    &lt;pic:spPr&gt;
                                                        &lt;a:xfrm&gt;
                                                            &lt;a:off x="0" y="0" /&gt;
                                                            &lt;a:ext cx="2194560" cy="1463040" /&gt;
                                                        &lt;/a:xfrm&gt;
                                                        &lt;a:prstGeom prst="rect"&gt;
                                                            &lt;a:avLst /&gt;
                                                        &lt;/a:prstGeom&gt;
                                                    &lt;/pic:spPr&gt;
                                                &lt;/pic:pic&gt;
                                            &lt;/a:graphicData&gt;
                                        &lt;/a:graphic&gt;
                                    &lt;/wp:inline&gt;
                                &lt;/w:drawing&gt;
                            &lt;/w:r&gt;
                        &lt;/w:p&gt;
                    &lt;/w:body&gt;
                &lt;/w:document&gt;
            &lt;/pkg:xmlData&gt;
        &lt;/pkg:part&gt;
        &lt;pkg:part pkg:name="/word/media/image1.png" pkg:contentType="image/png" pkg:compression="store"&gt;
            &lt;pkg:binaryData&gt;
                iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAMAAAHN6w8ZAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
                jwv8YQUAAAAGUExURQAAAAAAAKVnuc8AAAACdFJOU/8A5bcwSgAAAAlwSFlzAAAOxAAADsQBlSsO
                GwAAAAxJREFUGFdjYBgYAAAAeAABoRR6NAAAAABJRU5ErkJggg==
            &lt;/pkg:binaryData&gt;
        &lt;/pkg:part&gt;
    &lt;/pkg:package&gt;
</code></pre>

<p>I'm not sure whether above one is correct or not but it keeps giving me error "Invalid format" while adding to MS word using programming".
The error is
<strong>Error Message: The format of the specified data object is invalid.
Error Code: 2006</strong></p>

<p>Here is click event for the buttonw which is inserting code...</p>

<pre><code>Office.context.document.setSelectedDataAsync
(
    xmlCode,
    { coercionType: "ooxml" }, 
    function (result)
    {
        console.log("test");
    }
);
</code></pre>

<p>variable xmlCode is consists of ooxml code as string data.</p>