|
-
Aug 6th, 2003, 08:06 AM
#1
Thread Starter
New Member
Word to PDF With VBA **RESOLVED**
This is very simple in theory, but I cannot seem to figure it out.
I have a Word document that I want to convert to a PDF document via VBA code inside of work. Adobe Acrobat 5.0 is installed.
The following code is from a macro I recorded when printing the Word document to a PDF document; however, I cannot figure out how to specify the filename in the code...
ActivePrinter = "Acrobat Distiller"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
Hopefully someone can help.
Thanks.
Last edited by steven506; Aug 6th, 2003 at 10:54 AM.
-
Aug 6th, 2003, 10:53 AM
#2
Thread Starter
New Member
I came up with a solution...
Sub printToPDFFile()
Dim PDFFileName As String
'Define the path and filename
PDFFileName = "C:\temp\testing.PDF"
ActivePrinter = "Acrobat Distiller"
SendKeys PDFFileName & "{ENTER}", False
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
End Sub
There may be a better way to go about this, but it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|