I
intoit
Hi,
I'm using excel 2003 and I've got Acrobat Distiller/Professional Version 8.
Currently, I've got some vba code that creates a ppt presentation and then
saves it as a ppt file based on the name of the excel file from which a
series of charts and text are imported. The code I'm using to save the ppt
works great (see below). Now, I would like to print the ppt file into a pdf
file. I found some vba code on the net that appears relevant to my problem,
but I can't figure out how to modify it for my purposes.
Thanks for any advice.
***code I'm using to save ppt file
Dim sName As String
sName = ActiveWorkbook.Name
sName = Mid$(sName, 1, InStr(sName, ".") - 1)
sName = ActiveWorkbook.Path & "\" & sName & ".ppt"
PP.ActivePresentation.SaveAs Filename:=sName
Application.DisplayAlerts = True
***Code I found on the net to print an excel range to pdf file
Private Sub CommandButton1_Click()
' Define the postscript and .pdf file names.
Dim PSFileName as String
Dim PDFFileName as String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.pdf"
' Print the Excel range to the postscript file
Dim MySheet As WorkSheet
Set MySheet = ActiveSheet
MySheet.Range("myRange").PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prtofilename:=PSFileName
' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
End Sub
I'm using excel 2003 and I've got Acrobat Distiller/Professional Version 8.
Currently, I've got some vba code that creates a ppt presentation and then
saves it as a ppt file based on the name of the excel file from which a
series of charts and text are imported. The code I'm using to save the ppt
works great (see below). Now, I would like to print the ppt file into a pdf
file. I found some vba code on the net that appears relevant to my problem,
but I can't figure out how to modify it for my purposes.
Thanks for any advice.
***code I'm using to save ppt file
Dim sName As String
sName = ActiveWorkbook.Name
sName = Mid$(sName, 1, InStr(sName, ".") - 1)
sName = ActiveWorkbook.Path & "\" & sName & ".ppt"
PP.ActivePresentation.SaveAs Filename:=sName
Application.DisplayAlerts = True
***Code I found on the net to print an excel range to pdf file
Private Sub CommandButton1_Click()
' Define the postscript and .pdf file names.
Dim PSFileName as String
Dim PDFFileName as String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\myPDF.pdf"
' Print the Excel range to the postscript file
Dim MySheet As WorkSheet
Set MySheet = ActiveSheet
MySheet.Range("myRange").PrintOut copies:=1, preview:=False,
ActivePrinter:="Acrobat Distiller", printtofile:=True, collate:=True,
prtofilename:=PSFileName
' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""
End Sub