By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,965 Members | 1,962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,965 IT Pros & Developers. It's quick & easy.

[XP] Batch-print bunch of RTF files?

P: n/a
Hello,

I have about two hundred individual RTF files to print from an
XP host. Word 2000 doesn't seem to have this feature, so I'm looking
for a way to print those RTF files from an ActivePython script. Would
someone have some working code handy?

Thank you.
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
no****@nospam.com wrote:
Hello,

I have about two hundred individual RTF files to print from an
XP host. Word 2000 doesn't seem to have this feature, so I'm looking
for a way to print those RTF files from an ActivePython script. Would
someone have some working code handy?

Thank you.
Sure it does, just not the way you think.

- Click on Start-Settings-Printer and Faxes
- Double-click the printer you want to print to
- Open folder where your 200 RTF files are stored.
- Drag and drop the file on to the printer window and your machine
will launch and print each of thes in Word.

-Larry
Jun 27 '08 #2

P: n/a
On Jun 4, 12:26 pm, "nos...@nospam.com" <Gilles@wrote:
Hello,

I have about two hundred individual RTF files to print from an
XP host. Word 2000 doesn't seem to have this feature, so I'm looking
for a way to print those RTF files from an ActivePython script. Would
someone have some working code handy?

Thank you.
The code below will print one file from your current directory to the
default printer. You should be able to tweak it to your needs.

import sys
import os
from win32com.client import Dispatch
MYDIR = os.getcwd() + '/'
myWord = Dispatch('Word.Application')
myWord.Visible = 1 # comment out for production
myDoc = myWord.Documents.Open(MYDIR + sys.argv[1])
myDoc.PrintOut()
myDoc.Close()
Jun 27 '08 #3

P: n/a
On Wed, 04 Jun 2008 11:37:30 -0500, Larry Bates
<la*********@websafe.com`wrote:
>Sure it does, just not the way you think.
Thanks guys, that did it. I had to print in smaller batches because
200 in one shot caused Word to crash, but I got the job done.
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.