![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: MS Word mail merge automation
From: Steve M <sjmaster@gmail.com>
Date: Wed Oct 05 2005 - 20:25:56 CEST
I was finally able to get things working right, so I thought I'd stick
"""An example of a MS Word mail merge using the COM interface.
doc_template_name = os.path.abspath('template.doc')
app = win32com.client.Dispatch("Word.Application")
mm = doc_template.MailMerge
#attach data source to template
#merge just one record - this step may be redundant
#send the merge result to a new document
#merge
#apparently app.Documents is like a stack
#save our new document
#cleanup
|