Print documents in alphabetical order 
Author Message
 Print documents in alphabetical order

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



Fri, 07 Nov 2003 21:49:36 GMT  
 Print documents in alphabetical order
If the list is sorted by filename, wouldn't it do that anyway?

--
Suzanne S. Barnhill
Microsoft Word MVP
Words into Type
Fairhope, AL USA


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



Fri, 07 Nov 2003 22:25:49 GMT  
 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



Sat, 08 Nov 2003 01:19:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Printing documents in alphabetical order

2. Print documents in alphabetical order

3. to cross a table in alphabetical order

4. Automatic alphabetical order

5. Alphabetical order

6. Help, dir : how to class files by alphabetical order

7. DBCombo to show fields in alphabetical order

8. sorting array values in alphabetical order

9. listbox alphabetical order

10. Alphabetical Order

11. Alphabetical order

12. Sort strings in alphabetical order

 

 
Powered by phpBB® Forum Software