Connecting Tech Pros Worldwide Help | Site Map

Pivot Table to Word (via vba copy/paste)

christianlott1@yahoo.com
Guest
 
Posts: n/a
#1: Jul 11 '07
I want to copy an Access pivot table into word with vba.

I'm guessing I'd need to Select All, copy to the clipboard, and paste
special into word at a bookmark.

I know how to address the bookmark, I just don't know how to select,
copy and paste (actually, I will probably be able to find the paste
special command for word) via vba.

Right now I have:
--------------
DoCmd.OpenForm "frm_pvt_Amend_Area_Union2", acFormPivotTable

SendKeys ("^a")
SendKeys ("^c")

DoCmd.Close acForm, "frm_pvt_Amend_Area_Union2"
---------------

I'm going to need to cause the routine to 'wait' or 'sleep' before I
close the pivot table form because right now it closes before the keys
reach it. Other than that it pastes fine.

These commands didn't work for me (caused an error - only available in
design mode?):

'DoCmd.RunCommand acCmdSelectAll
'DoCmd.RunCommand acCmdCopy



Thanks,

Christian

christianlott1@yahoo.com
Guest
 
Posts: n/a
#2: Jul 12 '07

re: Pivot Table to Word (via vba copy/paste)


On Jul 12, 9:06 am, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
Quote:
On Wed, 11 Jul 2007 13:04:35 -0700, "christianlo...@yahoo.com"
>
<christianlo...@yahoo.comwrote:
>
Sendkeys has an extra optional argument to make things more
sequential. Read up on it in the help file.
Thanks for that!

Closed Thread