Document property of IEHtmlWindow

Christof Ecker wrote:

Hi,

I need to access the Document property of IEHtmlWindow widget.

>>> import wx.lib.iewin as iewin
>>> ie = iewin.IEHtmlWindow(frame)
>>> ie.document
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "c:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\lib\iewin.py", line 252, in _get_Document
    return self.GetAXProp('Document')
  File "c:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\activex.py", line 324, in GetAXProp
    return _activex.ActiveXWindow_GetAXProp(*args, **kwargs)
TypeError: Unable to convert value to expected type: (VT_EMPTY) for property <Document>

Robin Dunn answered to a similar question, that accessing non-trivial properties is not possible with the current activex.py. However, It was possible with some older versions.

What I tried (without success) is:

- looking for an older activex.py in the svn
- using pywin32 to access the IEHtmlWidget

Look at the activexwrapper.py module, it should still be distributed with wxPython. There is an example of using it in this module:

http://svn.wxwidgets.org/viewvc/wx/wxPython/branches/WX_2_8_BRANCH/demo/ActiveXWrapper_IE.py

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!