Thread: [Solved] PasteAppendTable Question
View Single Post
 
Old 05-23-2013, 01:30 PM
danenorman13 danenorman13 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: May 2013
Posts: 1
danenorman13 is on a distinguished road
Default PasteAppendTable Question

I am working on a code that appends some data copied from excel and appended to a current table in a word document. The problem I am having is that my PasteAppendTable command is not working correctly. I have listed my code below:

Code:
Sub ChangeTable()
Dim rngParagraphs As Range

Set rngParagraphs = ActiveDocument.Range( _
Start:=ActiveDocument.Tables(3).Range.Start, _
End:=ActiveDocument.Tables(3).Range.End)

rngParagraphs.Style = "Table Columns 2"
rngParagraphs.Rows.Last.Select
Selection.InsertRowsBelow (1)
Selection.PasteAppendTable
rngParagraphs.Style = "Table Grid"

End Sub
I thought maybe I could move the cursor to the first cell of the new last row and that would fix things but I haven't been able to figure that out either. Any help is greatly appreciated!
Reply With Quote