locked
Word 2007 looses tabs in document header RRS feed

  • Question

  • Windows XP

    Office 2007

    All service packs and maintenance applied.

    I created a document in which I want the first 2 lines of the body included in the documents header.  I created two bookmarks, m1 which contained the text to be included from the first line and m2 which contained the text to be included from the second line.  I then created the document header.  The header consists of 2 lines.  I set a right justified tab in each of the two lines at the right margin. On the left side of the first and second lines of the header I placed common info used in every document for the project.  Following the common text on line 1 of the header I inserted a tab and a cross reference to m1 and following the common text on line 2 of the header I inserted a tab and a cross reference to m2.  Everything looked just as I wanted. 

    I then changed the text in m1 and m2.  The information in the documents header did not change on the display.  I then printed the document and observed that the document header printed the changed text in m1 and m2 and the display now contained the changed text in m1 and m2 BUT the right justified tabs were gone and thus m1 and m2 were not positioned correctly on the display or on the printed page. 

    I added space tab space between the common info and the bookmark xref and re-set the right justification tab.  The document looked good on display

    I then printed the document.  The first header line printed as desired and still looked good on display.  The second header again lost the right justification tab and thus both displayed and printed incorrectly.

    I changed the text in m1 and m2 and re-set the right justification tab in the second line of the header.  The header info did not change on the display but did become right justified.

    I then printed the document. The header printed with the text of the updated bookmarks and the display now showed the updated text but line 2 again lost the right justification tab and thus both displayed and printed incorrectly. 

     

    What am I doing incorrectly???

     

     

    Thursday, September 23, 2010 3:59 PM

Answers

  • Ctrl+A then F9 will update the fields in the body of the document.

    But to update those in the headers, Print Preview is the simplest, even in code

    With ActiveDocument
        .PrintPreview
        .ClosePrintPreview
    End With

    Otherwise, you have to use

    Dim i as long, j as long
    WIth ActiveDocument
        For i = 1 to .Sections.Count
            With .Sections(i)
                For j = 1 to .Headers.Count
                    .headers(j).Range.Fields.Update
                Next j
                For j = 1 to .Footers.Count
                    .footers.(j).Range.Fields.Update
                Next j
            End With
        Next i
        .Range.Fields.Update
    End With

    -- Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Rod Horning" wrote in message news:dbfd5000-d545-455c-88e1-27285e3847d5@communitybridge.codeplex.com...

    Doug

    Thank you very much.

    The problem was that the bookmarks included the paragraph marker.  I removed the paragraph marker from the bookmarks and the display and print worked as desired.

    Other than either printing or doing a print preview, does WORD hava a setting that will cause the text in the cross reference to display updates automatically or else via a command?

    Thank you for your assistance.


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    • Marked as answer by Jennifer Zhan Monday, September 27, 2010 2:53 AM
    Saturday, September 25, 2010 2:04 AM

All replies

  • Try using a two column, two row borderless table in the header with the common text in the first column and the cross references in the second column with the paragraph format in that column right aligned.  You will need to make sure that the bookmarks do not include any end of paragraph marks (¶) as that may be the cause of the problem.

    -- Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Rod Horning" wrote in message news:ca1279f9-e4cd-4dfa-9adb-8d4a8cf15d6c@communitybridge.codeplex.com...

    Windows XP

    Office 2007

    All service packs and maintenance applied.

    I created a document in which I want the first 2 lines of the body included in the documents header.  I created two bookmarks, m1 which contained the text to be included from the first line and m2 which contained the text to be included from the second line.  I then created the document header.  The header consists of 2 lines.  I set a right justified tab in each of the two lines at the right margin. On the left side of the first and second lines of the header I placed common info used in every document for the project.  Following the common text on line 1 of the header I inserted a tab and a cross reference to m1 and following the common text on line 2 of the header I inserted a tab and a cross reference to m2.  Everything looked just as I wanted.

    I then changed the text in m1 and m2.  The information in the documents header did not change on the display.  I then printed the document and observed that the document header printed the changed text in m1 and m2 and the display now contained the changed text in m1 and m2 BUT the right justified tabs were gone and thus m1 and m2 were not positioned correctly on the display or on the printed page.

    I added space tab space between the common info and the bookmark xref and re-set the right justification tab.  The document looked good on display

    I then printed the document.  The first header line printed as desired and still looked good on display.  The second header again lost the right justification tab and thus both displayed and printed incorrectly.

    I changed the text in m1 and m2 and re-set the right justification tab in the second line of the header.  The header info did not change on the display but did become right justified.

    I then printed the document. The header printed with the text of the updated bookmarks and the display now showed the updated text but line 2 again lost the right justification tab and thus both displayed and printed incorrectly.

    What am I doing incorrectly???


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    Thursday, September 23, 2010 10:36 PM
  • Doug

    Thank you very much. 

    The problem was that the bookmarks included the paragraph marker.  I removed the paragraph marker from the bookmarks and the display and print worked as desired.

    Other than either printing or doing a print preview, does WORD hava a setting that will cause the text in the cross reference to display updates automatically or else via a command?

    Thank you for your assistance.

    Friday, September 24, 2010 9:02 PM
  • Ctrl+A then F9 will update the fields in the body of the document.

    But to update those in the headers, Print Preview is the simplest, even in code

    With ActiveDocument
        .PrintPreview
        .ClosePrintPreview
    End With

    Otherwise, you have to use

    Dim i as long, j as long
    WIth ActiveDocument
        For i = 1 to .Sections.Count
            With .Sections(i)
                For j = 1 to .Headers.Count
                    .headers(j).Range.Fields.Update
                Next j
                For j = 1 to .Footers.Count
                    .footers.(j).Range.Fields.Update
                Next j
            End With
        Next i
        .Range.Fields.Update
    End With

    -- Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Rod Horning" wrote in message news:dbfd5000-d545-455c-88e1-27285e3847d5@communitybridge.codeplex.com...

    Doug

    Thank you very much.

    The problem was that the bookmarks included the paragraph marker.  I removed the paragraph marker from the bookmarks and the display and print worked as desired.

    Other than either printing or doing a print preview, does WORD hava a setting that will cause the text in the cross reference to display updates automatically or else via a command?

    Thank you for your assistance.


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    • Marked as answer by Jennifer Zhan Monday, September 27, 2010 2:53 AM
    Saturday, September 25, 2010 2:04 AM
  • Thank you
    Saturday, September 25, 2010 6:01 AM