On which page is textbox?

B

Bart

Hi,

I'm using the following code to process textboxes in a document:

For Each Boxt In TDoc.Shapes
With Boxt.TextFrame
If .HasText Then
' Some processing
End If
End With
Next

Now I need the number of the page on which the current textbox
resides.
How do I determine that pagenumber?

TIA!

Bart
 
J

Jonathan West

Bart said:
Hi,

I'm using the following code to process textboxes in a document:

For Each Boxt In TDoc.Shapes
With Boxt.TextFrame
If .HasText Then
' Some processing
End If
End With
Next

Now I need the number of the page on which the current textbox
resides.
How do I determine that pagenumber?

pagenum = TDoc.Anchor.Information(wdActiveEndPageNumber)
 
B

Bart

TDoc.Anchor.Information(wdActiveEndPageNumber)

Thanks, Jonathan, but that results in an error 438 (... not supported
for this object).

BTW, I want to insert the pagenumber with the contents of the textbox
in an other document that is already open en that is the current
document.
Does that make any difference?

Bart
 
J

Jonathan West

Bart said:
Thanks, Jonathan, but that results in an error 438 (... not supported
for this object).

BTW, I want to insert the pagenumber with the contents of the textbox
in an other document that is already open en that is the current
document.
Does that make any difference?

Bart

Sorry, misread your For Each line. Should be this

BoxT.Anchor.Information(wdActiveEndPageNumber)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top