2-page letter repeats 1st page in 2nd page header

R

R. Choate

I have a large app in Word that calls a letterhead template file to apply letterhead on the 1st page. Once I finally got that
working, a new problem cropped up. When the letter is longer than one page, I have some code (shown below) for applying certain
information in the header on the 2nd page. Now, instead of getting that, I'm getting the entire first page of the letter repeated in
the 2nd page header. None of the stuff I want in the 2nd page header shows up. Here is my code for the 2nd page header. It is in a
sub by itself:

MyDate = DateSerial(Year(Date), Month(Date), Day(Date))
Application.ScreenUpdating = False
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)

.Range.Fields.Add Range:=ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range, _
Type:=wdFieldEmpty, Text:="REF clientname", PreserveFormatting:=False
.Range.InsertAfter vbCr
.Range.InsertAfter Format(MyDate, "mmmm d, yyyy")
.Range.InsertAfter vbCr
.Range.InsertAfter "Page " & _
ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
.Range.Font.Size = 10
.Range.ParagraphFormat.Alignment = wdAlignParagraphLeft

End With

End Sub

Please help. I finally got the letterhead working but I can't have this new problem ruin everything. Here is the code which calls
the letterhead template:

'starts new document
strPath = "C:\Documents and Settings\Administrator\Desktop\"
strName = "Letterhead template.dot"
Documents.Add Template:=strPath & strName, _
NewTemplate:=False, _
DocumentType:=wdNewBlankDocument, _
Visible:=True
 
C

Cindy M -WordMVP-

Hi R.,
.Range.Fields.Add Range:=ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range, _
Type:=wdFieldEmpty, Text:="REF clientname", PreserveFormatting:=False
Have you checked where the bookmark clientname is actually located, and what it contains? My
thought would be that it's holding the text of the document...

Also, just to check, you do have "Different First Page" activated in File/Page Setup/Layout?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :)
 
R

R. Choate

Hi Cindy,

It is interesting how far away the people are who I get help from (or sometimes give help to in Excel and Access). I believe your
question is at the heart of the problem and I'll be looking into that in just a few minutes. I'm counting on that being the answer.
If not, I'll be back. As to your 2nd question, I do have "Different First Page" selected and that part seems to be doing OK. The
letterhead does not show up on the subsequent pages.

Thanks Cindy,
--
RMC,CPA


.Range.Fields.Add Range:=ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range, _
Type:=wdFieldEmpty, Text:="REF clientname", PreserveFormatting:=False
Have you checked where the bookmark clientname is actually located, and what it contains? My
thought would be that it's holding the text of the document...

Also, just to check, you do have "Different First Page" activated in File/Page Setup/Layout?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top