template - header setting gets reversed

M

M.Hitzert

We use a template in Word 2003 in which a header has to start on page
2. This template works fine on most of the computers in our office
(~60, all XPSP2/Office 2k3). On two computers however the template
gives the user a document with a header on the first page and no header
on page 2 and the rest!?! It looks to me that the settings for the
header made in the template gets reversed. What can cause this
behaviour?

Marc
 
S

Suzanne S. Barnhill

Is the template set up with Header and First Page Header, or does it try to
use a section break? If the latter, the user is perhaps typing on the
"wrong" side of the break?
 
M

M.Hitzert

The template seems to use a section/page break. I found the following
code.

Sub pagina2()
Selection.InsertBreak Type:=wdPageBreak
ActiveWindow.ActivePane.View.Type = wdPageView
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
Selection.Font.Name = "Arial"
Selection.Font.Size = 8
Selection.TypeText Text:="Blad "
ActiveWindow.Selection.Fields.Add Range:=Selection.Range,
Type:=wdFieldEmpty, Text:="PAGE ", PreserveFormatting:=True
Selection.TypeText ", brief d.d. " & strDatum & vbCr
If strBetreft <> "" Then
Selection.TypeText "Inzake " & strBetreft
End If

End Sub


I think I can rule out 'typing on the wrong side'. If that was the case
this problem would occure on every computer.
 
S

Suzanne S. Barnhill

I would start from scratch, eliminating the code, and use the headers Word
provides for the purpose. In addition to the First Page Header and Header,
you can also, by checking "Different odd and even" as well as "Different
first page" (on the Layout tab of Page Setup) have an Odd Page Header and
Even Page Header. For more on how to set this up, see
http://sbarnhill.mvps.org/WordFAQs/Letterhead.htm and
http://sbarnhill.mvps.org/WordFAQs/HeaderFooter.htm

Let me emphasize that even a single-page template can contain up to three
headers. Even though they can't be seen until pages are added, Word will
remember the headers you have created.
 
M

M.Hitzert

I'm afraid I can't start from scratch. The template starts with a
dialog in which information about the recipient and the sender has to
be entered. The sender can be one of the many different organizational
units we have. The code goes from there and gives the letter its
appropriate look. There is a lot of code involved and I'm not the one
that made this template ...
 
M

M.Hitzert

I found out that when I mark out the first line of the above code
(Selection.InsertBreak Type:=wdPageBreak) I get the exact problem. Now
I have to find out why this bit of code doesn't work on two computers.
 
Top