View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
voodooJoe voodooJoe is offline
external usenet poster
 
Posts: 43
Default converting ppt to pdf launched from xls

yes. i'm not sure if its the only way, but i have used the Acrobat
Distiller to do this.

using this method : you need to have adobe installed and a VBA reference
set, print to ps file, use distiller to convert to pdf

you also need to set the activeprinter to the 'adobe printer' that installs
when you install acrobat (get this name by going into the vba immediate
window and typing "?activeprinter"
yes, you still need to even though the print line calls the activerprinter -
don't know why, but mine crashed w/o it
i put that value in a custom document property

the psfilename i used is a temp name like "tmp.ps" that the loop uses and
kills over and over

Public Const PSFileName As String = "tmp.ps"
Public myPDF As PdfDistiller

Private Sub CreatePDF(ws As Worksheet, TargetDirectory, PDFFileName)
If myPDF Is Nothing Then Set myPDF = New PdfDistiller
Application.ActivePrinter =
ThisWorkbook.CustomDocumentProperties("AdobePrinte r").Value
ws.Range("Print_Area").PrintOut copies:=1, Preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prtofilename:=TargetDirectory & PSFileName
myPDF.FileToPDF TargetDirectory & PSFileName, TargetDirectory &
PDFFileName & ".pdf", ""
Kill TargetDirectory & PSFileName
If Len(Dir(TargetDirectory & PDFFileName & ".log")) 0 Then Kill
TargetDirectory & PDFFileName & ".log"
End Sub

- voodooJoe

"pm" wrote in message ...
hello,

is there any possibility to convert powerpoint file (ppt) into pdf?

file structure is shown below:

xls files - powerpoint - pdf

and i'd like to write VBA in one of xls files, which
1. open ppt file
2. update automaticly hiperlinks (to mentioned xls files without
notification
about links), as charts, and tables which are pasted as hiperlinks
3. save ppt which is necessary before converting
4. convert into pdf file
5. close ppt file

the reason of my question is that i have to create almost 300 pdf files,
which
(i think) can be created in some loop in VBA..