A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem saving PDF within VBA



 
 
Thread Tools Display Modes
  #1  
Old November 24th, 2009, 08:57 PM posted to microsoft.public.powerpoint
Wi11y13
external usenet poster
 
Posts: 40
Default Problem saving PDF within VBA

I am trying to save a slide in pdf format using Powerpoint 2007. I am finding
that it works on some machines but not others. The specifics are Powerpoint
2007, Adobe Reader 9.2. Here is the code:

Set oTempPres = Presentations.Open("c:\Cert.pptx", WithWindow:=False)
With oTempPres
For x = .Slides.Count To 1 Step -1
If .Slides(x).SlideIndex currentSlide Then
.Slides(x).Delete
End If
Next
.SaveCopyAs "c:\Cert.pptx"
.SaveAs FileName:="c:\Cert.pdf", fileformat:=ppSaveAsPDF
...........

I know some of you have assisted me within this forum before and have been a
great help. Anyone have any idea why this might work sometimes and not
others. It always works on my machine - whether I am executing the module
from the web (I know it is actually doing the executing on my machine) or
locally. This really has me frustrated now :-(

Thanks so much for the help..
--
Wi11y13
  #2  
Old November 25th, 2009, 02:32 AM posted to microsoft.public.powerpoint
Shyam Pillai
external usenet poster
 
Posts: 622
Default Problem saving PDF within VBA

Hi,
Do you have the Save As PDF add-in for Office 2007 installed? You can only
run the ppSaveAsPDF enum if it is installed else it will give an automation
error.

Regards,
Shyam Pillai

Image Importer Wizard: http://skp.mvps.org/iiw.htm


"Wi11y13" wrote in message
...
I am trying to save a slide in pdf format using Powerpoint 2007. I am
finding
that it works on some machines but not others. The specifics are
Powerpoint
2007, Adobe Reader 9.2. Here is the code:

Set oTempPres = Presentations.Open("c:\Cert.pptx", WithWindow:=False)
With oTempPres
For x = .Slides.Count To 1 Step -1
If .Slides(x).SlideIndex currentSlide Then
.Slides(x).Delete
End If
Next
.SaveCopyAs "c:\Cert.pptx"
.SaveAs FileName:="c:\Cert.pdf", fileformat:=ppSaveAsPDF
..........

I know some of you have assisted me within this forum before and have been
a
great help. Anyone have any idea why this might work sometimes and not
others. It always works on my machine - whether I am executing the module
from the web (I know it is actually doing the executing on my machine) or
locally. This really has me frustrated now :-(

Thanks so much for the help..
--
Wi11y13


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.