Code to Print Current Document as PDF File in a Desired Folder

S

Steve

I’m trying to write a macro that will that will print the current document
that’s open to pdf file in a desired folder (in my case the folder is drive
z:\word).

I’m using Word 2007 with Adobe Pro v8.

In doing some research, it seems that I need to write a VBA code to
accomplish the task. I have a very limited knowledge base when it comes to
writing code. Here's what I've come up with so far.


Sub PrintPDF()
'
' PrintPDF Macro
'
'
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

Sub OpenFolder()
With Application.Dialogs(wdDialogFileOpen)
.Name = "Z:\Word"
.Show
End With
End Sub
 
D

Doug Robbins - Word MVP

If you set the properties for the Adobe PDF printer so that it does not ask
for the filename, it will automatically save the file with the path\filename
of the document that is being printed. Therefore have you macro first save
the document to the desired folder, then print the document and if you did
not want a copy of the Word document in that folder, use the Kill command to
delete it after closing it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top