Live Scores
Shareware
Movie Stars
in
Word
Applications
(Entire Site)
Questions and answers to issues related to Microsoft: Windows, Applications, Development, Hardware, Server, Internet Protocols, Database, Exchange .
»
Applications
»
Microsoft Office
»
Word
»
Copy Word Table via VBA
Copy Word Table via VBA
I a class module I need to copy a table to paste it later to a PowerPoint slide.
but the .copy method pops an error with err4605 'no text selected'.
Hm, but the table is selected. I don't understand it. If I manually execute row 5 again after the error occurs in row 7, the code is doing what it is supposed to do.
Any idea?
Working with the sel-variable was my try to solve it.
The same with mWordObj and mDocument.activate
1Public Sub Table_CopyToClipboard(Opti
onal ByVal TableIndex As Long = 1)
2 Dim sel As Word.Selection
3 mWordObj.Activate
4 mDocument.Activate
5 mDocument.Tables(TableInde
x).Select
6 Set sel = mWordObj.Selection
7 mWordObj.Selection.Copy
8End Sub
Solution: Copy Word Table via VBA
Have you tried:
mDocument.Tables(TableInde
x).Range.C
opy
Regards,
Rory