none
What is "Section" means in Word document? RRS feed

  • Question

  • According to PIA object model word document is represented with Documnet object. Content of document is available through "Section" propert of Document object.

    Sometimes word document contain a lot of sections. But is not clear how word create new section.

    Does it word create sections automatically? What section contain? How document organised?

    Should we loop over all Section objects (via Sections property) each time when we analyze document text, when change headers-footers, etc?


    • Edited by digor_ua Monday, October 24, 2011 4:22 PM
    Monday, October 24, 2011 4:21 PM

Answers

  • Hi Digor

    Supplementing Hans's response:

    Word will create a new section when the user requests a change in the number of columns, margins or page orientation "from this point forward" or for a selection.

    There's no need to loop all sections when you're working with the main body of document text and are interested only in the text.

    It is necessary if you want to work with headers and footers, or if you need to analyze page layout settings such as the number of text columns or changes in page orientation.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Bruce Song Wednesday, November 2, 2011 7:17 AM
    Tuesday, October 25, 2011 6:10 AM
    Moderator
  • Roughly speaking, a section is a subdivision of a document that has its own page layout (page margins, page orientation, number of text columns, headers and footers).

    When you create a blank new document, it contains a single section. You create new sections by inserting section breaks.

    So indeed, if you want to analyze the page layout of a document, it makes sense to loop through its sections.

    See:

    http://kb.iu.edu/data/aayy.html

    http://addbalance.com/usersguide/sections.htm

    http://support.microsoft.com/kb/291184/en-us


    Regards, Hans Vogelaar
    • Marked as answer by Bruce Song Wednesday, November 2, 2011 7:17 AM
    Monday, October 24, 2011 4:29 PM

All replies

  • Roughly speaking, a section is a subdivision of a document that has its own page layout (page margins, page orientation, number of text columns, headers and footers).

    When you create a blank new document, it contains a single section. You create new sections by inserting section breaks.

    So indeed, if you want to analyze the page layout of a document, it makes sense to loop through its sections.

    See:

    http://kb.iu.edu/data/aayy.html

    http://addbalance.com/usersguide/sections.htm

    http://support.microsoft.com/kb/291184/en-us


    Regards, Hans Vogelaar
    • Marked as answer by Bruce Song Wednesday, November 2, 2011 7:17 AM
    Monday, October 24, 2011 4:29 PM
  • Hi Digor

    Supplementing Hans's response:

    Word will create a new section when the user requests a change in the number of columns, margins or page orientation "from this point forward" or for a selection.

    There's no need to loop all sections when you're working with the main body of document text and are interested only in the text.

    It is necessary if you want to work with headers and footers, or if you need to analyze page layout settings such as the number of text columns or changes in page orientation.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by Bruce Song Wednesday, November 2, 2011 7:17 AM
    Tuesday, October 25, 2011 6:10 AM
    Moderator