Copy Unbound OLE Object to New PowerPoint Slde

D

David G.

I have a form with an unbound OLE object which is an MS Graph Chart.
What I would like to do is have the user click a button and:

1. Prompt the user for destination PPT
2. Insert a blank page at the end of the presentation
3. Copy / Transfer the chart to the new slide

I have the first 2 steps done, but I'm unsure of the easiest way to
get the OLE Object from Access to PowerPoint. Has anyone solved this
problem before?
 
S

Stephen Lebans

The simplest method would be to transfer the Image via the Clipboard.
Me.NameOfOLEObjectFrame.SetFocus
Me.NameOfOLEObjectFrame.Action = 4

' Set the focus back to your PP slide
' Issue a command to Paste

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
D

David G.

Ok I've used the code below in an attempt to copy and paste the OLE
object:

OLE2.SetFocus
OLE2.Action = 4

ppPres.Slides.Paste (ppPres.Slides.Count - 1)

The object is copied to the clipboard, but when the paste occurs I get
this error:

"-2147188160 Slides.Paste: Invalid request. Clipboard is empty or
contains data which may not be pasted here."

If I manually paste the contents of the clipboard, the OLE Object
comes in perfectly, so I must be missing somehting pretty simple here
(at least I hope). One possibility is that the object is copied as an
MS Graph Chart, and I may have to paste special which I don't know how
to do through code.
 
S

Stephen Lebans

You may have to repost this question in a PowerPoint NG. Let me know how
you make out.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top