locked
Combine multiple documents into single document, and maintain Heading numbering. RRS feed

  • Question

  • Hi

    I am currently developing an application for creating a word document based on certain chosen options.  The application opens up a .dotx template which contains some default content.  When the user checks checkboxes within the application it inserts other word documents in order to provide the relevant content within the main document using the following code:

     'When LAN Checkbox is clicked insert sections for LAN
            LANContent = LANBox.Checked
            If LANBox.CheckState = CheckState.Checked Then
                oDoc.Application.Selection.EndKey(Word.WdUnits.wdStory)
                oDoc.Application.Selection.InsertFile(FileName:="C:\Document_Creation\Supporting_Files\Content\LAN Overview.docx")

    This functionality is working fine, and the content is being populated however I have an issue regarding the headings outline numbering sequence.

    If for instance my main template document has the following headings:

    1

    1.1

    1.2

    1.3

    2

    2.1

    3

    3.1

    3.2

    Then the external document is inserted into this main document it also has the appropriate Heading 1 / Heading 2 headings etc and the normal text within the headings.  These are being inserted with the following:

    1

    1.1

    1.1.1

    etc.  I need the numbering to continue from that already present within the main document so it appears as

    4

    4.1

    4.1.1 etc.

    Is anyone able to assist me in resolving this issue?

    • Moved by Forrest Guo Wednesday, August 8, 2012 8:43 AM (From:Developing Apps for Office)
    Monday, August 6, 2012 2:41 PM

Answers

All replies