[Tutor] Add metadata to a dir of files.

Tim Golden mail at timgolden.me.uk
Thu Feb 22 21:16:21 CET 2007

Mark Bystry wrote:
> getting even closer. figure out how to write to a file but still in vbscript.
> dsofile_write.vbs
> code:
> Set objFile = CreateObject("DSOFile.OleDocumentProperties")
> objFile.Open("D:\test.txt")
> objFile.SummaryProperties.Category = "CAT54"
> objFile.Save

In Python, that's spelt:

import win32com.client
props = win32com.client.Dispatch ("DSOFile.OleDocumentProperties")
props.Open (r"c:\temp\test.txt")
props.SummaryProperties.Category = "CAT54"
props.Save ()


but when I tried doing it, I got a COM error on the line
where the Category is written. It worked ok with Subject
instead. Wouldn't have thought this was down to Python,
but I've not got much to go on!


More information about the Tutor mailing list