Hello, I’m trying to use Microsoft Office Document Imaging in Python. Here’s the reference for MODI Viewer Control. http://msdn.microsoft.com/en-us/library/aa167614(office.11).aspx It is said that, Loading a Document into the Viewer Control You can load a document into the viewer control by using either of the following properties: * Set the control's FileName property to the name of an existing MDI or TIF file. * Set the control's Document property to a document that is already loaded in memory. (In this case, the Filename property remains empty.)
I am able to create an instance of MODI.Document and MiDocViewer.MiDocView, but I had a problem loading the Document. The Document property is still None after I assigned a Document object to it. The FileName property is still an empty string after I assigned a file name to it. My code is as following: >>> import win32com.client >>> win32com.client.gencache.EnsureModule('{A5EDEDF4-2BBC-45F3-822B-E60C278A1A79}',0,11,0) <module 'win32com.gen_py.A5EDEDF4-2BBC-45F3-822B-E60C278A1A79x0x11x0' from 'C:\Python24\lib\site-packages\win32com\gen_py\A5EDEDF4-2BBC-45F3-822B-E60C278A1A79x0x11x0.py'> >>> doc = win32com.client.Dispatch("MODI.Document") >>> doc.Create("C:\some.file.TIF") >>> view = win32com.client.Dispatch("MiDocViewer.MiDocView") >>> view.FileName = "C:\some.file.TIF" >>> view.FileName u'' >>> view.Document = doc >>> view.Document >>> print view.Document None >>> Could anyone help me with how to load a Document into the Viewer Control please? Thanks in advance! Jolin
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32