write text in a first paragraph after a table

G

Gonzales

Hi,
I need to insert some text in the first paragraph after all tables in a
document.
How to access the first paragraph?
 
D

Doug Robbins

Dim i As Long, myrange As Range
For i = 1 To ActiveDocument.Tables.Count
Set myrange = ActiveDocument.Tables(i).Range
myrange.Collapse wdCollapseEnd
myrange.InsertBefore "Text"
Next i
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
A

alfonso gonzales

Thank you very much,
It comes in handy. :)

U¿ytkownik "Doug Robbins said:
Dim i As Long, myrange As Range
For i = 1 To ActiveDocument.Tables.Count
Set myrange = ActiveDocument.Tables(i).Range
myrange.Collapse wdCollapseEnd
myrange.InsertBefore "Text"
Next i
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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