RECrerar
08-17-2009, 07:23 AM
[Hi,
I am using the following code to insert some copied data as a table in word
' Insert section breaks so that landscape page set up only applied to current segment
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.MoveUp Unit:=wdLine, Count:=1
With Selection.PageSetup
.Orientation = wdOrientLandscape
.SectionStart = wdSectionNewPage
End With
Selection.PasteExcelTable True, False, True
What I then need to be able to do is identify the newly created table in the document so that I can format it. I'm quite new to word VBA so the question is: How do I identify the table?
Is it possible to create a bookmark when I create the table? or is there a way to link to the current table?
The table is currently just inserted at the cursor position. It could be anywhere in the document and will have similar content to several other tables, meaning I can't use a search for a specific heading.
I hope you can help
Robyn
I am using the following code to insert some copied data as a table in word
' Insert section breaks so that landscape page set up only applied to current segment
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.InsertBreak Type:=wdSectionBreakNextPage
Selection.MoveUp Unit:=wdLine, Count:=1
With Selection.PageSetup
.Orientation = wdOrientLandscape
.SectionStart = wdSectionNewPage
End With
Selection.PasteExcelTable True, False, True
What I then need to be able to do is identify the newly created table in the document so that I can format it. I'm quite new to word VBA so the question is: How do I identify the table?
Is it possible to create a bookmark when I create the table? or is there a way to link to the current table?
The table is currently just inserted at the cursor position. It could be anywhere in the document and will have similar content to several other tables, meaning I can't use a search for a specific heading.
I hope you can help
Robyn