• Warning:Referenced Bookmarks mustn't span section breaks

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Warning:Referenced Bookmarks mustn't span section breaks

    Author
    Topic
    #461943

    Here’s a quick way to confuse a document:

    1: Insert a table caption
    2: Above the caption, insert a cross-reference to, say, the caption and number, resulting in a nice little “Table 1”
    3: Right before the table caption, insert two section breaks (next-page style)
    4: Position the cursor between the two section breaks, and change the page orientation to landscape
    5: Click on the cross reference, then update the field (F9)

    Result: The section breaks are “dragged” into the cross reference, because inserting text just before a bookmark expands that bookmark, and the caption had acquired a hidden bookmark when the cross-ref was inserted. Really, any cross-ref will do, I don’t think it needs to be a hidden bookmark.

    It’s worse than you think (“It usually is,” says Mal): Go to the VB Editor and type

    Code:
    ? ActiveDocument.Sections(1).PageSetup.Orientation

    It will return the wdUndefined value (999999) — as will a number of other page setup parameters. That’s just sick. Especially if you have a routine to remove that landscape section which looks aet the previous section’s page setup, and tries to set the following one the same settings, as Word won’t let you set things to Undefined.

    Because these bookmarks are normally hidden, Word really ought not to expand them.
    I’m going to have to write a cleanup routine around my “Insert Landscape Section” routine to ensure that I don’t mung bookmarks.

    Viewing 1 reply thread
    Author
    Replies
    • #1174756

      Thanks for the warning, it’s good to keep this in mind.

      The problem occurs for ordinary bookmarks too, but it’s particularly annoying for hidden ones because there’s no visible clue that the bookmark has expanded, even if you display bookmarks in the document.

    • #1177744

      Here’s a quick way to confuse a document:

      1: Insert a table caption
      2: Above the caption, insert a cross-reference to, say, the caption and number, resulting in a nice little “Table 1”
      3: Right before the table caption, insert two section breaks (next-page style)
      4: Position the cursor between the two section breaks, and change the page orientation to landscape
      5: Click on the cross reference, then update the field (F9)

      Result: The section breaks are “dragged” into the cross reference, because inserting text just before a bookmark expands that bookmark, and the caption had acquired a hidden bookmark when the cross-ref was inserted. Really, any cross-ref will do, I don’t think it needs to be a hidden bookmark.

      It’s worse than you think (“It usually is,” says Mal): Go to the VB Editor and type

      Code:
      ? ActiveDocument.Sections(1).PageSetup.Orientation

      It will return the wdUndefined value (999999) — as will a number of other page setup parameters. That’s just sick. Especially if you have a routine to remove that landscape section which looks aet the previous section’s page setup, and tries to set the following one the same settings, as Word won’t let you set things to Undefined.

      Because these bookmarks are normally hidden, Word really ought not to expand them.
      I’m going to have to write a cleanup routine around my “Insert Landscape Section” routine to ensure that I don’t mung bookmarks.

      Nice Serenity reference, there!

    Viewing 1 reply thread
    Reply To: Warning:Referenced Bookmarks mustn't span section breaks

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: