Re: Embedding a PDF OLE object in PowerPoint 2003
- From: Steve Rindsberg <abuse@xxxxxxxxxxxxx>
- Date: Wed, 12 Nov 2008 17:21:05 EST
In article <AA49967C-DD42-484D-B140-846966872B20@xxxxxxxxxxxxx>, John Dumay
wrote:
Hi all,
I am an Access programmer and i want to display PDF documents created in my
Access application which display custom made graphs in a powerPoint slide(s).
Right off, I see that your subject line says "Embedding" but your code is
asking for a link. Which are you after?
Also, Outfile is not dimensioned or set to any value in the code example. I'm
assuming that you just snipped out the bit where that happens?
IAC, if I modify your code like so and run it from within Excel it works ...
should behave pretty much the same from w/in Access, I'd think:
Private Sub ExportToPowerPoint()
'Dim db As Database, rs As Recordset
' not needed for the example and Excel spits at me
' if I don't comment it out
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
On Error GoTo err_cmdOLEPowerPoint
' Open up an instance of Powerpoint.
Set ppObj = New PowerPoint.Application
' Added this line so I could watch what's going on in PPT
ppObj.Visible = True
Set ppPres = ppObj.Presentations.Add
' Setup a slide and link to the pdf
With ppPres
With .Slides.Add(1, ppLayoutBlank)
.Shapes.AddOLEObject Left:=50, Top:=50, Width:=500, Height:=500, _
Filename:="C:\folder\name_of_file.pdf", _
DisplayAsIcon:=msoFalse, Link:=msoTrue
End With
End With
' commented this out so it doesn't auto close;
' however, when I left it in, the show DID display my PDF
' Run the show.
'ppPres.SlideShowSettings.Run
Exit Sub
err_cmdOLEPowerPoint:
MsgBox Err.Number & " " & Err.Description
End Sub
All of my code seems to work fine except that when the PPT is displayed it
displays a Adobe Icon not the document I want it to display. if i do this
manually rather than from code it works fine, so there isn't a problem with
the PDF document I have created.
Also, how do i programmically save the current publication (with a save as
dialogue box preferred) from my Access application?
The code from my Access looks like this (PowerPoint 11 Library is used as a
reference)
Thanks,
John
Private Sub ExportToPowerPoint()
Dim db As Database, rs As Recordset
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
On Error GoTo err_cmdOLEPowerPoint
' Open up an instance of Powerpoint.
Set ppObj = New PowerPoint.Application
Set ppPres = ppObj.Presentations.Add
' Setup a slide and link to the pdf
With ppPres
With .Slides.Add(1, ppLayoutBlank)
.Shapes.AddOLEObject Left:=50, Top:=50, Width:=500, Height:=500,
FileName:=sOutFile, DisplayAsIcon:=msoFalse, Link:=msoTrue
End With
End With
' Run the show.
ppPres.SlideShowSettings.Run
Exit Sub
err_cmdOLEPowerPoint:
MsgBox Err.Number & " " & Err.Description
End Sub
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
.
- Follow-Ups:
- Re: Embedding a PDF OLE object in PowerPoint 2003
- From: John Dumay
- Re: Embedding a PDF OLE object in PowerPoint 2003
- References:
- Embedding a PDF OLE object in PowerPoint 2003
- From: John Dumay
- Embedding a PDF OLE object in PowerPoint 2003
- Prev by Date: Re: When will PPT default to either 16:9 or 16:10
- Next by Date: Contineous Looping PowerPoint Show problem
- Previous by thread: Embedding a PDF OLE object in PowerPoint 2003
- Next by thread: Re: Embedding a PDF OLE object in PowerPoint 2003
- Index(es):
Relevant Pages
|
Loading