Re: Embedding a PDF OLE object in PowerPoint 2003



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
================================================


.



Relevant Pages

  • multiple document viewew
    ... Anyone know of an Office 2003 document (Word, Excel and Powerpoint) AND PDF ... viewer, ... I need to display the contents of a library ...
    (microsoft.public.sharepoint.portalserver)
  • multiple document viewew
    ... Anyone know of an Office 2003 document (Word, Excel and Powerpoint) AND PDF ... viewer, ... I need to display the contents of a library ...
    (microsoft.public.sharepoint.windowsservices)
  • multiple document viewew
    ... Anyone know of an Office 2003 document (Word, Excel and Powerpoint) AND PDF ... viewer, ... I need to display the contents of a library ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: pdf in java Viewing... Not a good experience
    ... > BUT I need to know the external pdf viewers name ... This code is austensibly to open a url in a browser, but on Windows it will ... static class to display a URL in the system browser. ...
    (comp.lang.java.gui)
  • Re: latex in Office 2008:mac
    ... If you're converting from pdf, ... Might it be that PowerPoint is grabbing some low-res preview version ... rather than the full res file, sort of thing? ... to use Powerpoint out of sheer unfamiliarity with beamer. ...
    (comp.text.tex)

Loading