Prevent Tables.Add Jumping To Selection?

G

George Lee

Adding Tables or rows to tables always jumps to the insert point. Although
most of the time this is not a problem, there are instances that I use range
rather than Selection to insert material into a file. In those cases, Add
always jumps to one location and ScrollIntoView jumps to another and it looks
awful.

Is there a way to prevent jumping to the insert point?

As a sample:

'table already defined
For Each myRevision In theSource.Revisions

theCount = theCount + 1
targetDoc.Tables(1).Rows.Add

With targetDoc.Tables(1)
.Cell(Row:=theCount + 1, Column:=1).Range.InsertAfter
Text:=theCount
'and other stuff
End With

targetDoc.Windows(1).ScrollIntoView targetDoc.Tables(1).Cell _
(Row:=theCount + 1, Column:=1).Range, False
Next
 

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