Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Win32 COM (MS Word Automation) Question

100 views
Skip to first unread message

Thomas Heller

unread,
Jan 26, 1998, 3:00:00 AM1/26/98
to

I know this question is really more Word than Python oriented,
but I use python win32 com to drive word, so here we go:

I have installed a BSCW server (see http://bscw.gmd.de for more info)
at a computer here and I'm trying to install a text-converter.
This converter should translate MS Word into HTML, so I thought,
MS Word should be able to do this.

I wrote the following script:

> import sys
> sys.stderr = sys.stdout
> import win32com.client
>
> print "Converting %s to %s" % (sys.argv[1], sys.argv[2])
>
> app = win32com.client.Dispatch ("Word.Application")
> try:
> docs = app.Documents
> d = docs.Open (sys.argv[1])
> d.SaveAs (sys.argv[2], 100) # html-export
> d.Close()
> finally:
> app.Quit()

It really works when started from the command line.
When it is started by the BSCW server (running on
NT 4.0, MS Office 97, with IIS running under the system account)
I get the following error message:

> c:\bscw3\data\Temp\tmp11>c:\python\python
c:\bscw3\server\src\converters\doc2html.py c:\bscw3\data\Temp\tmp11\tmp12
@232
> Converting c:\bscw3\data\Temp\tmp11\tmp12 to @232
> Traceback (innermost last):
> File "c:\bscw3\server\src\converters\doc2html.py", line 10, in ?
> d = docs.Open (sys.argv[1])
> File ">", line 2, in Open
> File "win32com\client\dynamic.py", line 162, in _ApplyTypes_
> pywintypes.com_error: (-2146822307, 'OLE error 800a175d', (0, 'Microsoft
Word', 'Could not open macro storage.', 'wdmain8.hlp', 25461,
->2146822307), None)
> c:\bscw3\server\src\converters\doc2html.bat
c:\bscw3\data\Temp\tmp11\tmp12 @232 > @232@232

What does this mean? Which macro storage could not be
opened and why?

PS: Are there other converters from Word or Excel to HTML
which I can use?

Regards
Thomas Heller


Mark Hammond

unread,
Jan 27, 1998, 3:00:00 AM1/27/98
to

>It really works when started from the command line.
>When it is started by the BSCW server (running on
>NT 4.0, MS Office 97, with IIS running under the system account)
>I get the following error message:

A big problem could be that the "current user" when run under the System
Account will not have MS Office settings available. Also, the system
account is very restricted, so if it is attempting to load anything from the
network it is almost certain to die...

Can you change the user of IIS just for the sake of testing to see if that
is indeed the problem.....

Mark.


0 new messages