Hi Hari,
<snip> I get the message that secion 1 starts at page 1 and then the Macro
</snip>
Excellent. That means that you have only one section in your Word document.
In this case, instead of using a macro, I recommend that you simply view the
Header/Footer (whereever you want the page number to appear) and insert the
page field. Then move to the end of your TOC, instead a Next Page break,
making sure that you don't Link the Headers to Previous and insert a nested
field { = {Page} - 31 }. If you need more help with
Sections/Headers-Footers/Page Numbering, then I recommend that you spend
some time browsing the pertinent areas of www.word.mvps.org
HTH,
Dave
> Hi Dave,
>
[quoted text clipped - 48 lines]
> > Dim oSec As Section
> > For Each oSec In ActiveDocument.Sections
oSec.Headers(wdHeaderFooterPrimary).PageNumbers.RestartNumberingAtSection
> > =
> > False
[quoted text clipped - 69 lines]
> >> Hari
> >> India
Hari Prasadh - 28 Jan 2005 05:37 GMT
Hi David,
I am sorry, actually, Im not using Word's numbering feature and in the
present case due to the nature of the document I cannot/ do not want to use
word's numbering feature.
Let's say in middle of a page there is a text which says " The present page,
which is page 9 gives information regarding water properties" or some other
page might have "The present page, which is page 25 gives information
regarding water's peculiarities".
What I want to do is replace the above page 9 or page 25 with actual word
page number MINUS 31.
So, if the first text appeared in page 86 and second text appeared in page
99 then I want a macro which does a Replace with of the above text and the
final result would like :
" The present page, which is page 55 gives information regarding water
properties"
"The present page, which is page 68 gives information regarding water's
peculiarities"
55 has come from 86-31
68 has come from 99-31.
So I want a for loop which goes through whole of the document and searches
for "Page ?" or "Page ??" and if it is found then replace it with -- "Page "
& X -- where X is the actual word page number minus 31.
I just need the syntax for
a) programmatically finding the pagenumber of a particular page (I will use
this in If condition) and
b) programmatically looping sheet by sheet (will use this in the FOR loop).
Please guide me.
Thanks a lot,
Hari
India
> Hi Hari,
>
[quoted text clipped - 163 lines]
>> >> Hari
>> >> India
Hari Prasadh - 28 Jan 2005 14:14 GMT
Hi David,
I got my solution (resorted to Multi-posting and Helmut W helped me out).
Actually now I have come to realize that text which I was trying to replace
was part of *Main Story*.
I hope next time I have an issue, Iam able to use some technical jargon
pertaining to word in order to express my needs in a better manner.
Thnx a TON for your help.
Regards,
Hari
India