Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem saving PDF within VBA

46 views
Skip to first unread message

Wi11y13

unread,
Nov 24, 2009, 3:57:01 PM11/24/09
to
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

Shyam Pillai

unread,
Nov 24, 2009, 9:32:24 PM11/24/09
to
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" <Wi1...@discussions.microsoft.com> wrote in message
news:19ABDAD2-A65D-453F...@microsoft.com...

Steve Rindsberg

unread,
Nov 24, 2009, 10:12:52 PM11/24/09
to
In article <19ABDAD2-A65D-453F...@microsoft.com>, Wi11y13 wrote:
> 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 :-(


What Shyam said. The method you're using doesn't call on Adobe Acrobat, so it
won't matter what version of that is installed (or none at all).

If you've got the SaveAsPDF addin installed (or have applied SP2, which installs
it automatically), you'll be able to do what you're after but not otherwise.


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


Wi11y13

unread,
Nov 25, 2009, 9:07:01 AM11/25/09
to
If we execute this module from a server, does this add-on need to be
installed on every client that runs it? I know that the PP instructions are
actually being executed from the client and not the server is why I ask. Is
there another way to actually save the slide in pdf format? I am worried that
not everyone would have this add-on on their machine and it could be executed
both from inside the University and from a private machine at home. Not sure
I can require the add-on for every machine which is why maybe another
solution might work if there is one.

Thanks again for the help.
--
Wi11y13


"Steve Rindsberg" wrote:

> .
>

Steve Rindsberg

unread,
Nov 25, 2009, 10:34:57 AM11/25/09
to
In article <0D7D8DBF-2AAC-4828...@microsoft.com>, Wi11y13 wrote:
> If we execute this module from a server, does this add-on need to be
> installed on every client that runs it?

I'm not sure exactly what you mean by "execute this module from a server".

Let's put it this way: the add-in must be installed in the copy of PPT that
you're executing. It becomes part of that copy of PPT for all practical
purposes.

If people are logging into e.g. a Citrix server and running the software there,
then the add-in must be installed on the server. Their own PC is not doing much
more than acting as a smart terminal in that case, so it doesn't much matter
what's installed there.

No matter what solution you use, it's going to require *some* sort of software
that's capable of making PDFs. The PPT add-in is by far the simplest to install
and automate, and at $0.00 per copy, the least expensive.


>I know that the PP instructions are
> actually being executed from the client and not the server is why I ask. Is
> there another way to actually save the slide in pdf format? I am worried that
> not everyone would have this add-on on their machine and it could be executed
> both from inside the University and from a private machine at home. Not sure
> I can require the add-on for every machine which is why maybe another
> solution might work if there is one.
>
> Thanks again for the help.

Wi11y13

unread,
Nov 25, 2009, 11:48:25 AM11/25/09
to
Thanks Steve. As always - jolly on the spot :-)

We are accessing the module through a central server but the actions are
actually taking place on the client (each client needed a registry change in
order to download and execute the .ppsm file correctly) so now each client
also needs this add-on.

Again, kudos to you and this discussion group......
--
Wi11y13


"Steve Rindsberg" wrote:

> .
>

0 new messages