{"id":254,"date":"2007-06-19T17:36:23","date_gmt":"2007-06-19T16:36:23","guid":{"rendered":"http:\/\/www.itwriting.com\/blog\/?p=254"},"modified":"2007-06-19T17:36:23","modified_gmt":"2007-06-19T16:36:23","slug":"office-open-xml-vs-com-automation","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/254-office-open-xml-vs-com-automation.html","title":{"rendered":"Office Open XML vs COM automation"},"content":{"rendered":"<p>Looking at the new <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyId=AD0B72FB-4A1D-4C52-BDB5-7DD7E816D046&amp;displaylang=en\" target=\"_blank\">Open XML API<\/a>, introduced by Kevin Boske <a href=\"http:\/\/blogs.msdn.com\/kevinboske\/rss.aspx\" target=\"_blank\">here<\/a>, makes you realise that old-style COM automation wasn&#8217;t so bad after all.<\/p>\n<p>There are two distinct aspects to working programmatically with OOXML. First, there&#8217;s the Packaging API, which deals with how the various XML files which make up a document get stored in a ZIP archive. Second, there&#8217;s the XML specification itself, which defines the schema of elements and attributes that form the content of an OOXML document.<\/p>\n<p>The new wrapper classes really only deal with the packaging aspect. You still have to work out how to parse and\/or generate the correct XML content using your favourite XML parser. And it&#8217;s a lot more complex then HTML.<\/p>\n<p>By contrast, the old COM automation API for Office presents a programmatic object model for the content, and you don&#8217;t have to worry much about how the document gets stored &#8211; you just tell Word or Excel to save it. <\/p>\n<p>The (very big) downside of the COM object model is that it depends on the presence of Microsoft Office. High resource requirements, version problems, Windows-only, and inappropriate for server apps.<\/p>\n<p>We seem to have traded one problem for another. What Microsoft needs to provide is wrapper classes for the content, rather than just&nbsp;its packaging.<\/p>\n<div class=\"wlWriterSmartContent\" id=\"0767317B-992E-4b12-91E0-4F059A8CECA8:277baca2-bc2a-4c96-9e26-11170f1c4bec\" contenteditable=\"false\" style=\"padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px\">Technorati tags: <a href=\"http:\/\/technorati.com\/tags\/ooxml\" rel=\"tag\">ooxml<\/a>, <a href=\"http:\/\/technorati.com\/tags\/com\" rel=\"tag\">com<\/a>, <a href=\"http:\/\/technorati.com\/tags\/office\" rel=\"tag\">office<\/a>, <a href=\"http:\/\/technorati.com\/tags\/office%20xml\" rel=\"tag\">office xml<\/a>, <a href=\"http:\/\/technorati.com\/tags\/microsoft\" rel=\"tag\">microsoft<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Looking at the new Open XML API, introduced by Kevin Boske here, makes you realise that old-style COM automation wasn&#8217;t so bad after all. There are two distinct aspects to working programmatically with OOXML. First, there&#8217;s the Packaging API, which deals with how the various XML files which make up a document get stored in &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/254-office-open-xml-vs-com-automation.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Office Open XML vs COM automation<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,80,97],"tags":[],"class_list":["post-254","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-software-development","category-windows"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":0,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/254\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}