Embedding a PDF OLE object in PowerPoint 2003

J

John Dumay

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).

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
 
J

John Dumay

Hi Steve,

Thanks for your help. it all worked fine.

I als changed the Link:=msoFalse so that it doesn't update the file (ie
embeds it) into the document. THis was my first experience in programming
PowerPoint so on a bit of a learning cure.

Reggards,

John Dumay
 

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