How to embed a document within a docx file?
I'm trying to write a docx file which has embedded files within it. I have the "Op开发者_开发百科en XML SDK" and used that to examine an existing docx file (which had a .DOC word file and an .MSG file embedded in it). I reflected the docx into C#, cut and pasted that into a project, ran it and, hey presto, I created an equivilent docx file.
However, the generated code has the embedded files as (hard-coded) streams, as are the images. So, I loaded my own resource bitmap image (the Word 2010 icon) and read it as a stream and now the generated docx file has my resource image in it. But it has lost the document title. It seems that when the original docx file was created, the images used have an icon, and the title of the document.
Is there a simple way to create an image like that, or do I have to construct it myself (ie. draw my resource icon into a bitmap and write the title to the bottom of the bitmap as well) ?
精彩评论