Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Word Document 'header/footer' via Word Object Library

Status
Not open for further replies.

SteveShanks

Programmer
Nov 28, 2001
112
GB
Hi All

As the title suggests really, I can access everything I need on a Word document opened via the Word Library object but I can't find how I access the headers and footers of a docuemnt

Many Thanks
Steve
 
Using the macro recorder in Word provided this code. It may work as a starting point for you:

Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/22/2005 by zr94077
'
    If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
        ActiveWindow.Panes(2).Close
    End If
    If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
        ActivePane.View.Type = wdOutlineView Then
        ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.TypeText Text:="sdfasdf"
    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top