I am writing a Word add-in which is supposed to store some own XML data per document using Word object model and its CustomXMLPart
. The problem I am now facing is the lack of IStream
-like functionality for reading/writing XML to/from a CustomXMLPart
. It only provides BSTR
interface and I am puzzled how to handle UTF-8 XMLs with BSTR
s. To my understanding an UTF-8 XML file should really never have to undergo this sort of Unicode conversion. I am not sure what to expect as a result here.
Is there another way of using Word automation interfaces to store arbitrary custom information inside a DOCX file?