Ashish
Forum Replies Created
-
AuthorPosts
-
Hey Eric,
It’s me again! Well I was able to solve the problem using FormattingAssembler, as you had suggested. The flattened content resembles source content, with numbers and bullets, and the client is happy with that.
Thank you for your help and keep doing what you’re doing!It seems I might be able to use FormattingAssembler for my problem. However, my work computer has VS 2010 and I couldn’t find the OpenXMLPowerTools version that is compatible with VS 2010. Is there a way to make the existing version compatible to VS 2010? Or some other work around you suggest!
“When you set up your list of sources for DocumentBuilder, first include the numbered content at the beginning of the document. This should be the first source in your list of sources. Make a note of the number of paragraphs that you have inserted. This will pull in the numbering definitions from Doc A.”
Please pardon my ignorance. IF possible, could you please show this in code example?
Thank you for the prompt response Eric.
I didn’t properly explain the scenario to you, and I apologize for that.
Both the source (Doc A) and destination (Doc B) live in SharePoint. The code is configured in a web part and is executed at a list item menu click.Doc B is created from a Template document which also lives in SharePoint in a doc library. The code creates Doc B from the Template, copies content of Doc A and inserts into Doc B (specific section -Row 2 of a table). Everything works fine, except for the numbering. It of course is not copied from the source.
As a manual test, after Doc B (DocB.docx) is created I opened it in Visual studio using PowerTools for VS, opened numbering.xml and deleted everything inside w:abstractNum. Then I opened Doc A in VS and copied everything inside the w:abstractNum and pasted in the w:abstractNum section of Doc B. The numbering in Doc B looked the same as in the Doc A when opened in MS Word. It worked!
So, I was wondering if the same could be achieved with code- check if Doc A has numberingpart, if Yes then copy its abstractNum content from numbering.xml, and replace it with the abstractNum content of Doc B.
Banging my head on this for the better part of last week, still clueless and even more dazed than when I had begun!
- This reply was modified 8 years, 9 months ago by Ashish.
-
AuthorPosts