stuck on COM interface to Word

Kiss, Arpad AKiss at GEOMETRIA.hu
Tue Aug 3 10:31:39 CEST 1999


Hi Jim,
Here is an example:
	import time
	print time.ctime(int(doc.BuiltInDocumentProperties("Last Print Date")))
The online help contains other useful keywords(find the details of the
DocumentProperty): "Title","Subject","Author" etc.
Regards,
Arpad


Jim Kerr <jbkerr at sr.hp.com> wrote in message
news:<37A60515.370B5085 at sr.hp.com>...
>   I'm trying to write a python script to extract some properties from a set
> of Word documents. The attributes I'm interested in are things like author's
> name, last print date, keywords, etc.
> 
>   This is what I have so far:
> 
> from win32com.client import constants,Dispatch
> import string,os
> 
> app = Dispatch('Word.Application.8')
> app.Documents.Open(r"C:\My Documents\myMemo.doc")
> doc = app.ActiveDocument
> print "Last printed date: ",  # ?? what goes here ??
> 
>   I tried using combrowse.py to figure out what the properties of the
doc are,
> but I couldn't find anything that looked relevant.
> 
>   Is there any web-based info on COM interfaces to various programs? Or
do you
> have to buy Visual Basic books and translate for yourself?
> 
>   Thanks for the help!
> 
> 						Jim
> -- 
> Jim Kerr
> Hewlett-Packard
> Santa Rosa Systems Division
> 1400 Fountaingrove Pkwy, MS 3USZ
> Santa Rosa, CA 95403
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list