Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

How to Change Headers in word on different pages

Hello, I was wondering if anyone knew the code to place different headers on different pages in Word 2000.  I've tried all types of code but it changes the Headers for ALL pages whenever it run...please help!
0
TyWatts
Asked:
TyWatts
  • 6
  • 3
1 Solution
 
EssCommented:
In word 2000 all headers are the same for each section.  You can change headers for the first page or on odd or even pages but not each individual page.  What you need to do is break your document into individual sections for each page by inserting a section break for each page.  Then you can have different headers for each page.  Use the InsertBreak method to insert individual section breaks.
0
 
TyWattsAuthor Commented:
Okay, I'm implementing that now...
0
 
TyWattsAuthor Commented:
Okay, I'm implementing that now...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
TyWattsAuthor Commented:
That is not working for me.  Here is the blocks of code I'm using
-----
'sets the header
Sub Set_Header(vHeadertxt2)

  ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
   Selection.HeaderFooter.Range.Text = vHeadertxt2
   ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

---
'break
Sub Break()

'    Selection.InsertBreak Type:=wdPageBreak
    Selection.InsertBreak Type:=wdSectionBreakNextPage

   
    'StartProgram
    Set_Up_Dlg
End Sub
----

i'm still ending up with the same problem repetitive headers
0
 
TyWattsAuthor Commented:
That is not working for me.  Here is the blocks of code I'm using
-----
'sets the header
Sub Set_Header(vHeadertxt2)

  ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
   Selection.HeaderFooter.Range.Text = vHeadertxt2
   ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

---
'break
Sub Break()

'    Selection.InsertBreak Type:=wdPageBreak
    Selection.InsertBreak Type:=wdSectionBreakNextPage

   
    'StartProgram
    Set_Up_Dlg
End Sub
----

i'm still ending up with the same problem repetitive headers
0
 
TyWattsAuthor Commented:
I just made a small procedure block to do what was asked and this is still giving me repetative headers.

----------

Option Explicit

Dim count As Integer

Public Sub test()

count = count + 1
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
activewindow.ActivePane.View.

   Selection.HeaderFooter.Range.Text = count
   ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
  Selection.InsertBreak Type:=wdPageBreak
'  Selection.InsertBreak Type:=wdSectionBreakContinuous

end sub


---------

frustration is setting in, someone please help!
0
 
DocMCommented:
Ess is right. On the Header and Footer toolbar, make sure Same as Previous  is not selected.
0
 
EssCommented:
If you need to set the new header in the new section to not the same as previous, use the headerfooter object property LinkToPrevious = False.
0
 
EssCommented:
Instead of using wdSectionBreakContinuous why not use wdSectionBreakNextPage and eliminate the page break.
0
 
TyWattsAuthor Commented:
okay thanks Ess I appreciate it, and the 25 is yours.  Thanks again!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now