Page 1 of 1

WordprocessingMLPackage.load

PostPosted: Wed Sep 29, 2010 10:07 pm
by sharu1484
Hello Jason,
I am able to load a file using opc, however I need it in WordprocessingMLPackage. When I try to cast it to WordprocessingMLPackage and save I get Failed to add parts from relationships" Exception.

How to resolve this?

Regards,
Sharad

Re: WordprocessingMLPackage.load

PostPosted: Wed Sep 29, 2010 11:55 pm
by jason
You'll need to post:

(1) your code
(2) your document - renamed as a zip, and
(3) the stack trace

if I am to help.

Re: WordprocessingMLPackage.load

PostPosted: Tue Oct 05, 2010 3:39 pm
by sharu1484
Hello Jason,
The above mentioned issue is resolved. New issue is whenever I create a wordMLPackage and then load a .docx file using below code:
LoadFromZipNG zipNG = new LoadFromZipNG();
wordMLPackage = (WordprocessingMLPackage)zipNG.get("InputWordFile.docx");

Whatever was added to wordMLPackage before calling above code will be overwritten in the final output .docx file.
My requirement is to add certain parts/paragraphs in .docx file from different .docx files.
Please let me know if there is already a sample available for this?
Thanks a lot.

Regards,
Sharad

Re: WordprocessingMLPackage.load

PostPosted: Tue Oct 05, 2010 4:01 pm
by jason
You'll need to write the merge code yourself, or use altChunk. See recent posts on this topic.