can i use AccessibleObjectFromWindow function (oleacc.h) for retrieving address of the interface for the outlook window object

  add-in, c++, ms-word, outlook-addin

i am trying to resolve one bug on AccessibleObjectFromWindow
you can access doccumentation for the same on

I am unable retrive ppvObject for outlook whereas it works well for the ms word.

WindowPtr pdocWdw;
     HRESULT var = AccessibleObjectFromWindow( hControlWnd, DWORD(OBJID_NATIVEOM),
        __uuidof(WindowPtr), (PVOID*)&pdocWdw );
    _DocumentPtr pDoc;

    if(pdocWdw != NULL)
        m_pdocWdw = pdocWdw;
        pDoc = pdocWdw->Document;

for word pDoc = pdocWdw->Document; call returns proper value but in case of outlook it throws exception.

can anybody please tell if i can use AccessibleObjectFromWindow function for outlook if not what alternative i can use?

Source: Windows Questions C++