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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating fields values in a footer

Status
Not open for further replies.

Waiman

Programmer
Sep 11, 2001
15
GB
I'm trying to create a simple word macro that will allow people to create a standard propsal doc that uses around 23 variables. It's a standard document that will be used when creating a proposal, the only things that change are Client names, dates, etc.

I've managed to use input boxes, variables and field-DOCVARIABLE to allow a user to poplulate the document, but I can't seem to update fields that are inside a footer.

Can anyone please help?
 
If you're doing all this within a macro, then you may need to actually set the document view to the footer and then populate the field(s). After the field(s) are populated, then return to the main document view. There are several code variations that can accomplish this.
 
'****************************************************************************************
for example

...
vView = ActiveWindow.ActivePane.View.SeekView
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
'ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader 'header
Selection.EndKey Unit:=wdLine, Extend:=wdExtend 'select footers fi
Selection.Delete Unit:=wdCharacter, Count:=1 'delete selection (clear footer)
'Selection.TypeText Text:="354. " 'text what you want
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage 'page number, wdFieldDate - current Date
ActiveWindow.ActivePane.View.SeekView = vView
Application.ScreenUpdating = True
...
'****************************************************************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top