OpenXML Merging Documents - How to See Content using Productivity Tool -
i'm new , struggling openxml. have word template , depending on number of records user selects in website have, pull records out of database , use template create word document. assemble these documents 1 master word document served user. use openxml , altchunks this:
string altchunkid = "altchunkid" + itemno.tostring(); maindocumentpart mainpart = mydoc.maindocumentpart; alternativeformatimportpart chunk = mainpart.addalternativeformatimportpart( alternativeformatimportparttype.wordprocessingml, altchunkid); using (filestream filestream = file.open(createdfilename, filemode.open)) { chunk.feeddata(filestream); filestream.close(); } altchunk altchunk = new altchunk(); altchunkproperties altchunkproperties = new altchunkproperties(); matchsource matchsrc = new matchsource(); matchsrc.val = true; altchunkproperties.append(matchsrc); altchunk.appendchild(altchunkproperties); altchunk.id = altchunkid; mainpart.document.body.append(altchunk); mainpart.document.save();
when open 1 of template documents in productivity tool can see elements i'd expect:
however, when @ 'master' document, can down matchsource:
what don't understand why can't see paragraph tags etc in master document that's produced. can me understand how see information? there wrong document structure?
that's because of way altchunck
s merged master document. altchunck
s won't change master document's openxml
markup adds file as embedded resources. think of if attaching email not adding actual email body text. there third party solutions document builder merge document modifying master documents markup. can see expecting in productivity tool.
Comments
Post a Comment