Jay
Thu Jun 24 11:43:19 CDT 2004
Sonny Maou wrote:
> after i do
>
> activedocument.tables(1).range.copy
>
> how should i go about pasting it to the end of the document?
>
> Is there a better/faster way to copy a table to the end of the
> document?
>
> Thanks!!
Hi Sonny,
If you use the Copy method, it goes like this:
ActiveDocument.Tables(1).Range.Copy
Selection.EndKey unit:=wdStory
Selection.Paste
I don't care for that method, for two reasons: (1) If you had something on
the clipboard that you wanted to keep, it's replaced by the table, and (2)
it moves the cursor to the end of the document.
A better method IMHO is to use a Range object collapsed to the end of the
document, and just assign the table's .FormattedText to it:
Dim oRg As Range
Set oRg = ActiveDocument.Range
oRg.Collapse wdCollapseEnd
oRg.FormattedText = _
ActiveDocument.Tables(1).Range.FormattedText
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ:
http://word.mvps.org