
03-09-2012, 11:24 AM
|
|
Freshman
|
|
Join Date: Oct 2008
Posts: 26
|
|
Add Page Numbers to Word Document Footer
|
Hi!
I am trying to add page numbers to the footer of my report.
I want for it to appear as:
Text Page
(Please)
The code I have is as follows:
Code:
Dim currentFooter As HeaderFooter = oDoc.Sections(1).Footers(WdHeaderFooterIndex.wdHeaderFooterPrimary)
currentFooter.Range.InsertAfter(Today & "OMHSAS-MIS" & vbTab & vbTab & "Page ")
currentFooter.Range.Collapse(WdCollapseDirection.wdCollapseEnd)
currentFooter.Range.Fields.Add(currentFooter.Range, WdFieldType.wdFieldPage, True)
My problem is the page number replaces the text.
I would be very grateful for any help.
Ijaz
|
|