This is problematic because a Word page isn't actually a page until it
is displayed on a screen or printed on paper. That done, pages shown
on my screen or from my printer may very well be different that those
shown on yours. For an excellent explanation of all of this see:
http://daiya.mvps.org/wordpages.htm
That said, a crude method, and with limitations would look something
like this:
Sub ScratchMacro()
Dim oRng1 As Word.Range
Dim oCount As Long
ActiveDocument.Bookmarks("\startofdoc").Select
Set oRng1 = Selection.Range
Do
Set oRng1 = ActiveDocument.Bookmarks("\Page").Range
oCount = oRng1.Tables.Count
MsgBox "There are " & oCount & " Tables on this page"
oCount = 0
oRng1.Collapse wdCollapseEnd
oRng1.Move wdCharacter, 1
oRng1.Select
Loop Until oRng1.End = ActiveDocument.Range.End - 1
End Sub
It would take more work to prevent tables that span accross a page from
being counted as as a separate table on each page.
> Hi!
>
[quoted text clipped - 24 lines]
> Help me please!
> Thanks! :-)
Vale - 25 Oct 2006 18:04 GMT
thank you for your help
I'm trying your "crude method" but in
oRng1.Move wdCharacter, 1
I must specificate the object wdChararcter
so i wrote
Dim cha as Word.wdCharactercase=..... what's case?
and sorry for my question:
the method Move() as you wrote it , it's ok for my use?
better move the range to the next page?
thank you
> This is problematic because a Word page isn't actually a page until it
> is displayed on a screen or printed on paper. That done, pages shown
[quoted text clipped - 52 lines]
> > Help me please!
> > Thanks! :-)
Vale - 25 Oct 2006 18:30 GMT
your crude method modified work!
don't read my previous post
I've found the right function to go to the next page
I wrote
oRng1.GoToNext(WdGoToItem.wdGoToPage)
instead of
oRng1.Move wdCharacter, 1
now I can go on with my program!
THAK YOU VERY MUCH! :-D