none
Not able to read actual auto numbers of word document using OpenXML RRS feed

  • Question

  • Hi,

    We use openXML in our application to read the word document content. And before we start to read actual document content we use openxml FormattingAssembler class(https://github.com/VisualOn/OpenXmlPowerTools-old/blob/master/FormattingAssembler.cs) and ListItemRetriver class (https://github.com/VisualOn/OpenXmlPowerTools-old/blob/master/ListItemRetriever.cs)  to read the list numbers/Auto numbers of the document. 

    I have a document where after section break the auto numbers are resetting from 1 but even though the numbers are reseted, Open xml is reading auto numbers continuously.

    Ex : The last auto number in section one was 2 after section break even though it is starting from 1 OpenXML read it as 3.

    Is there any way how we can make auto numbers to reset after section break or How to read the actual auto number of the document after section break ?

    Thanks,
    Gayatri
    Tuesday, April 3, 2018 4:15 PM

All replies

  • Hi GayatriK,

    You had asked,"Is there any way how we can make auto numbers to reset after section break or How to read the actual auto number of the document after section break ?"

    The w:numId can contain a value of 0, which is a special value that indicates that numbering was removed at this level of the style hierarchy. While processing this markup, if the w:val='0', the paragraph does not have a list item.

    So in your code, you need to find this numid value to 0 to restart the numbering.

    Reference:

    Working with Numbered Lists in Open XML WordprocessingML

    Defining a Particular Level - Restart Numbering

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 4, 2018 7:17 AM
    Moderator
  • Hi GayatriK,

    Is your issue solved?

    I find that you did not follow up this thread after posting the issue.

    If your issue is solved then I suggest you to post your solution and mark it as an answer.

    If your issue is still exist then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 10, 2018 8:55 AM
    Moderator