开发者

OOXML :How can I Import altchunk elements after merging documents using Open XML SDK and altchunk?

开发者 https://www.devze.com 2023-04-02 05:58 出处:网络
I am using Open XML SDK and altchunk to merge multiple documents in a winforms application, after merging I want to manipulate paragraphs, the problem that until a document that contains altChunk elem

I am using Open XML SDK and altchunk to merge multiple documents in a winforms application, after merging I want to manipulate paragraphs, the problem that until a document that contains altChunk elements is opened and saved in Office, it still contains the altChunk parts, and not normal WordprocessingML markup of paragraphs, runs, and text elements. So I need to proceed to chunk importation to get the WordprocessingMl and to be able to manipulate paragraphs, runs, texts... The solution with SharePoint 2010 is that you can use Word Automation Services to update the documents that contains altChunk elements. After Word Automation Services processes it, the document will contain paragraphs, runs, and text elements, but here I am using winforms application. Is 开发者_JAVA技巧there a solution for this problem? Regards.


An altChunk approach to merging word documents relies on the consuming application (the application which opens the resulting document) to do the actual merging, like Word or Word Automation Services.

See: http://blogs.msdn.com/b/ericwhite/archive/2009/04/19/comparison-of-altchunk-to-the-documentbuilder-class.aspx

I don't think you will be able to reference the runs, paragraphs etc of the inserted document (altChunk) using the OpenXML API until this merging has been done. Maybe if you open the altChunk data and load that into a new WordprocessingDocument. But then maybe you could just make the changes to the documents before you merge them with altChunks?


As a workaround, I make copies for the merged documents, I proceed the changes on this copies, when the merged document is opened the altchunks are imported, in this way I keep the original merged documents content unchanged

0

精彩评论

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

关注公众号