Graham
Sat Jan 26 06:44:50 PST 2008
You should select the directory using the dialog that pops up when you run
the macro. It sounds as though you have used the same directory selection.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site
http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Srinivasulu B wrote:
> Hi Mayor,
> I ran this macro once.
> It worked fine.
> Then I tried to do the job for the docs in another directory.
> But is is doing the same as previous one.
> Am I doing anything wrong ?
> seea
>
>
> "Graham Mayor" <gmayor@REMOVETHISmvps.org> wrote in message
> news:eWkeeMAYIHA.5160@TK2MSFTNGP05.phx.gbl...
>> The following macro should work for all the documents in a selected
>> folder, subject your Acrobat settings.
>>
>> Sub BatchPrintPDF()
>> On Error GoTo err_FolderContents
>> Dim FirstLoop As Boolean
>> Dim DocList As String
>> Dim DocDir As String
>> Dim sPrinter As String
>>
>> With Dialogs(wdDialogCopyFile)
>> If .Display <> 0 Then
>> DocDir = .Directory
>> Else
>> MsgBox "Cancelled by User"
>> Exit Sub
>> End If
>> End With
>> If Documents.Count > 0 Then
>> Documents.Close savechanges:=wdPromptToSaveChanges
>> End If
>> Application.ScreenUpdating = False
>> FirstLoop = True
>> If Left(DocDir, 1) = Chr(34) Then
>> DocDir = Mid(DocDir, 2, Len(DocDir) - 2)
>> End If
>> DocList = Dir$(DocDir & "*.doc")
>> Do While DocList <> ""
>> Documents.Open DocList
>> With Dialogs(wdDialogFilePrintSetup)
>> sPrinter = .Printer
>> .Printer = "Adobe PDF"
>> .DoNotSetAsSysDefault = True
>> .Execute
>> End With
>> ActiveDocument.PrintOut
>> ActivePrinter = sPrinter
>> ActiveDocument.Close savechanges:=wdDoNotSaveChanges
>> DocList = Dir$()
>> FirstLoop = False
>> Loop
>> Application.ScreenUpdating = True
>> ActivePrinter = sPrinter
>> Exit Sub
>> err_FolderContents:
>> MsgBox Err.Description
>> Exit Sub
>> ActivePrinter = sPrinter
>> End Sub
>>
>>
>> Srinivasulu B wrote:
>>> Unfortunately it didn't
>>> What's the way out ?
>>> seena
>>> "DeanH" <DeanH@discussions.microsoft.com> wrote in message
>>> news:F5D8DF39-455C-42AC-A37D-A34BEAB6D7A3@microsoft.com...
>>>> In you orignal posting you did not say you wanted one file from
>>>> 2,500 files.
>>>> ;-)
>>>> If you use the Adobe, File, Create PDF, from Multiple Documents,
>>>> this will combine multiple files into one PDF. Also you have the
>>>> option to do this in
>>>> batches as there is an option to combine a new batch into an
>>>> extisting combined file.
>>>> Hope this helps
>>>> DeanH
>>>>
>>>> "Srinivasulu B" wrote:
>>>>
>>>>> Thanks
>>>>> It works...but a small catch.
>>>>> It is craeting a single file for all the docuemnts selected
>>>>> selected. But what I need one PDF file for one doc
>>>>> Can you help me
>>>>> However ...thanks again...for the timely help
>>>>> seena
>>>>> "DeanH" <DeanH@discussions.microsoft.com> wrote in message
>>>>> news:35769F82-139C-4F7D-A79C-A01793277EFB@microsoft.com...
>>>>>> In you Conversion Settings take off "View Adobe PDF result" and
>>>>>> "Prompt for
>>>>>> Adobe PDF file name". You should then be able to go the Windows
>>>>>> Explorer
>>>>>> and
>>>>>> multi select many files, Roght Mouse click, Convert to PDF, and
>>>>>> this should
>>>>>> work OK. I am using Adobe 7 Pro and this works fine.
>>>>>> Also within Adobe 7 there is the option to File, Create PDF, From
>>>>>> multiple
>>>>>> files, that works well.
>>>>>> Maybe some else here may have a macro that will do this for you.
>>>>>> I probably would not do all 2,500 docs at one time! ;-)
>>>>>> Hope this helps
>>>>>> DeanH
>>>>>> "Srinivasulu B" wrote:
>>>>>>
>>>>>>> I have about 2500 docs.
>>>>>>> Each is of one page.
>>>>>>> I have to make a PDF for each of these docs...one PDF for each
>>>>>>> doc. Now at this is what I have to do.
>>>>>>> 1. Open a doc.
>>>>>>> 2. Print it (to PDF)
>>>>>>> 3. Close it
>>>>>>> Repeat the process.
>>>>>>> Is there some kind of automated way of doing it
>>>>>>> seena
>>>>>>> PS
>>>>>>> I am using Acrobat 8 for making PDF files