H
Hari Prasadh
Hi,
I have a very large word document running to around 850 pages (5 MB).
The document has been created by exporting data from some other software
(WinCross - A tabulation software).
Actually the original software provides its own numbering at the Bottom
Middle and Top Right and we dont use the automatic numbering facility
provided by MS Word. The software which provides the numbering excludes the
Table of contents etc. Therefore page 1 embedded in Bottom Middle and Top
Right of the present document is Page 32 as per Word. Basically Word shows
31 pages ahead of the document page numbering logic.
Due to some problem with our software, numbering is not alright for the last
for the last 100 pages or so. Like for page number 775 (as per MS word) the
actual document shows Page 744 but for page 776 (as per MS word) the actual
document shows "Page 1" and for page 780 (as per MS word) the actual
document shows "Page 25". Basically the page numbering is mixed up after
page 775 (as per MS word)
Hence, I want a For Loop kind of macro which goes to all the pages in the
word and checks whether that page contains any instance of "Page X". if yes
then "Page X" is changed to "Page I-31" where X could be any number (1
digit, 2 digit) and I is the Actual page number as per word.
Im giving my crude version here.
Sub ReplaceTextWhichAreActuallyPageNumbers()
For I = 1 to TotalNumberOfPagesAsPerWord
If page(I).Searchfor("Page " &"?") or page(I).Searchfor("Page "
&"??") = True then
Replace("Page " &"?") or ("Page " &"??") = "Page "& I-31
End if
Next I
End Sub
(I program a little with Excel but not conversant with word.)
(I hope I have posted in the right group. Though this is a problem with
numbering, but since I think this requires VB, so I didnt post in the
Word.Numbering group. Also, Iam not as such using word's numbering
feature.Please tell me if I should post somewhere else)
Please guide me.
Thanks a lot,
Hari
India
I have a very large word document running to around 850 pages (5 MB).
The document has been created by exporting data from some other software
(WinCross - A tabulation software).
Actually the original software provides its own numbering at the Bottom
Middle and Top Right and we dont use the automatic numbering facility
provided by MS Word. The software which provides the numbering excludes the
Table of contents etc. Therefore page 1 embedded in Bottom Middle and Top
Right of the present document is Page 32 as per Word. Basically Word shows
31 pages ahead of the document page numbering logic.
Due to some problem with our software, numbering is not alright for the last
for the last 100 pages or so. Like for page number 775 (as per MS word) the
actual document shows Page 744 but for page 776 (as per MS word) the actual
document shows "Page 1" and for page 780 (as per MS word) the actual
document shows "Page 25". Basically the page numbering is mixed up after
page 775 (as per MS word)
Hence, I want a For Loop kind of macro which goes to all the pages in the
word and checks whether that page contains any instance of "Page X". if yes
then "Page X" is changed to "Page I-31" where X could be any number (1
digit, 2 digit) and I is the Actual page number as per word.
Im giving my crude version here.
Sub ReplaceTextWhichAreActuallyPageNumbers()
For I = 1 to TotalNumberOfPagesAsPerWord
If page(I).Searchfor("Page " &"?") or page(I).Searchfor("Page "
&"??") = True then
Replace("Page " &"?") or ("Page " &"??") = "Page "& I-31
End if
Next I
End Sub
(I program a little with Excel but not conversant with word.)
(I hope I have posted in the right group. Though this is a problem with
numbering, but since I think this requires VB, so I didnt post in the
Word.Numbering group. Also, Iam not as such using word's numbering
feature.Please tell me if I should post somewhere else)
Please guide me.
Thanks a lot,
Hari
India