Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORD to PDF automatic converting??

Status
Not open for further replies.

blin

Technical User
Jun 1, 2001
1
US
Hello,

I need to convert Word document to PDF using distiller constantly. I have recorded a macro as follows. It works OK. Just two things that are annoying:

1. Before the VB Macro close the document, it asked if I want to save the changes. How can I get rid of this automatic pop-up window?

2. Distiller keep asking for a name for saving the document. How can I integrate a piece of code to let distiller save the file using the name in word document with PDF extension.

Thanks a lot.

B. Lin


The code I used:

Sub WORD_to_PDF
'
'
The_Input_Path = "t:\output\"
ChangeFileOpenDirectory The_Input_Path
TheFile = Dir("*.doc")
Do
opfile = TheFile
Documents.Open FileName:=opfile, ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
Selection.WholeStory
Selection.Font.Name = "Monospac821 BT"
ActiveWindow.ActivePane.SmallScroll Down:=93
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
Selection.Font.Name = "Monospac821 BT"
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
ActiveDocument.Close

TheFile = Dir
Loop While TheFile <> &quot;&quot;
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top