开发者

How to embed a document within a docx file?

开发者 https://www.devze.com 2023-02-16 22:07 出处:网络
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 f

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) ?

0

精彩评论

暂无评论...
验证码 换一张
取 消