
Print documents in alphabetical order
Hi Rae,
The Dir command retrieves the files in the order they appear on disk. To
have them print in alphabetical order, you'll need to load the names in an
array, sort the array (easiest way is to use WordBasic.SortArray) then run
through the array printing the files.
If you need help doing this, post back.
--
Hope this helps.
ibby
Please post replies or follow-ups to the **newsgroup** so that participants
may benefit or contribute.
Quote:
> I use the following macro to print the entire contents of a nominated
> folder. Is there something I can add to it to make it print the documents
> in alphabetical order?
> =====================================================
> Sub PrintAllHRCRForms()
> '
> ' PrintAllCRForms Macro
> ' Print all documents in specified directory
> '
> numcopies = InputBox("Enter number of copies to print:", "Number of
Copies")
> Dialogs(wdDialogFileOpen).Show
> adoc = Dir("*.DOC")
> While adoc <> ""
> Application.PrintOut FileName:=adoc, copies:=numcopies
> adoc = Dir()
> Wend
> End Sub
> =====================================================
> Any thoughts would be appreciated.
> Rachel