How to move cursor to new paragraph after table

A

avkokin

Hello.
I need to move to new paragraph after the table. That code:
Sub table_1()
Dim oRange As Range
Dim oTable As Table
Set oRange = Selection.Range
Set oTable = ActiveDocument.Tables(1)
oRange.EndOf wdStory, wdMove
oRange.InsertAfter vbCr
???
End Sub
How to move cursor to new paragraph after this table?
Thank's
 
S

StevenM

To: Avkokin,

You need the following two lines:

oRange.Collapse wdCollapseEnd
oRange.Select

Also, in order to see what you code is doing, I often toss in the line:

oRange.Select

And then I step through the code one line at a time using Debug. You could
toss in such a line after each time you modify your range variable. This will
allow you to see what the range is doing. Once you understand what it is
doing, then you can omit all unnecessary lines.

Steven Craig Miller
 

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