STOCRIC
asked on
How to include VBA variables and field codes in a Word 2003 footer
I need to include a variable and a field code in a footer.
The var is called strReference
The field code is PAGE of NUMPAGES
so the final thing in the footer looks like this
Q1000023
Page 1 of 6
I can get the variable in OK, but I cannot figure out how to append the field code.
right justified
Thanks
Rich
The var is called strReference
The field code is PAGE of NUMPAGES
so the final thing in the footer looks like this
Q1000023
Page 1 of 6
I can get the variable in OK, but I cannot figure out how to append the field code.
right justified
Thanks
Rich
ASKER
I had looked at this before I posted the question, it doesn't address how to use a variable with a field code, only how to put nested field codes.
this is what I'm doing right now
'sets the footers for section 2 (all but the covering letter)
With ActiveDocument.Sections(2) .Footers(w dHeaderFoo terPrimary ).Range
.Text = "KSB Reference: " & strKSB_Ref
End With
I need the Page X of Y on the next line of the footer
Thanks
this is what I'm doing right now
'sets the footers for section 2 (all but the covering letter)
With ActiveDocument.Sections(2)
.Text = "KSB Reference: " & strKSB_Ref
End With
I need the Page X of Y on the next line of the footer
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Enjoy the cigar.
thanks very much indeed.
thanks very much indeed.
http://word.mvps.org/FAQs/MacrosVBA/NestedFieldsWithVBA.htm