Could a macro be written to print all the currently open Word files?
Could a macro be written to print all the currently open Word files?
~Anne Troy
Something like ..
For each d in Documents
d.printout
next
??
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Sweeeeeeeeeet.
~Anne Troy
I ended up with this. Is it correct?
[vba]Option Explicit
Sub PrintAll()
Dim d As Document
On Error Exit Sub
For Each d In Documents
d.PrintOut
Next
End Sub[/vba]
~Anne Troy
Looks good. Sorry about the sloppy code
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
No problem at all, Tony. I just want to make sure.
Do ya want to go ahead and add it to the kb?
~Anne Troy
Sure! Just like that? No clever stuff? Consider it done.
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Ann,
I had trouble with the error handler you used when I tried it in Word 2000. The following worked in my old version of Word.
[VBA]
Option Explicit
Sub PrintAll()
Dim d As Document
On Error GoTo ErrorHandler
For Each d In Documents
'uncomment the line that says d.PrintOut to actually print
'and comment or delete the line that says d.PrintPreview
'd.PrintOut
d.PrintPreview
Next
ErrorHandler:
Resume Next
End Sub
[/VBA]
It's a good idea, thanks for it.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
Thanks, Steve!
~Anne Troy