Generated Word Doc Right Justify Numbered List

Home Forums Open-Xml-Sdk Generated Word Doc Right Justify Numbered List

This topic contains 1 reply, has 2 voices, and was last updated by  Eric White 7 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3443

    lsdewitz
    Participant

    I am generating a Word Document using a template and replacing content controls using the Word Document Generator Library. When the content includes a numbered list the numbers are left justified and I need them to be right justified. I have looked at many ways to solve this (saving format in the template – not allowed, including the style in the html – does not work, etc), and I think the simplest is the replace w:lvljc w:val=”left” with w:lvljc w:val=”right” in the numbering portion of the xml prior to saving the document. Any suggestions on the best way to do so?

    #3462

    Eric White
    Keymaster

    I am not sure exactly what you are using when you refer to the ‘Word Document Generator Library’. Can you provide a link

    However, it is probably possible to post-process the document after you generate it, tweaking the formatting for the numbering as you desire. I say ‘probably’ because I am not clear on exactly what you are using, and what exactly is the form of the Open XML markup after you generate it.

    Have you taken a look at DocumentAssembler, which is a module in Open-Xml-PowerTools?

    DocumentAssembler Developer Center

    I am quite sure (although I haven’t tried it) that you could set up the numbering exactly the way you want it, and use a Repeat / EndRepeat to create repeating content, then use Content within that to specify the contents of each list item, and it will produce numbering in the exact format you want.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.