Embedding data in a Word 2007 docx file

J

John

Can somebody tell me if it is possible to embed a special XML file or
for that matter, any file into a Word docx zip file structure? I
would like to be able to store some data elements in the Word docx
file, that is not viewable when the document is opened in Word but can
be read by a java program at a later time. I have tried adding files
of various types in the structure but Word always chocks on it when I
try to open the file.

Thanks.

John.
 
C

Cindy M.

Hi John,
Can somebody tell me if it is possible to embed a special XML file or
for that matter, any file into a Word docx zip file structure? I
would like to be able to store some data elements in the Word docx
file, that is not viewable when the document is opened in Word but can
be read by a java program at a later time. I have tried adding files
of various types in the structure but Word always chocks on it when I
try to open the file.
You can certainly add a CustomXMLPart. I can't tell you how that's
stored in the file package (ZIP file), but it should be in the OpenXML
documentation.

Via the object model it's done using the CustomXMLPart.Add method. So
you could add one that way, then inspect the file package.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top