How to get Outlook Inspector as IDispatch object from window handl

Microsoft OFFICE

    Sponsored Links

    Next

  • 1. About 'collection' of vba
    Following is some some segment of vba in excel in one module public type tradeVO trade_date as date value_date as date deal_number as string ccy_bought as string ccy_sold as string end type public sub try() dim trades as new collection dim t as new tradeVO trades.add t end sub ------------------------------ there is a compile error: "only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions" what's it about? i can't get it
  • 2. OE6 & VB6
    Hi, everyone! I want to export all contacs in MS access database with VB source code. Do You have any tip how to do it? On what location contacs are saved? Please help me.
  • 3. AutoInstall Add-in (Excel)
    Hi, I made a Add-in (.xla) a I have to distribute for a lot of computers. How can I do it? Can I do it in the same .xla? How? Sorry for my poor english Rodrigo Ferreira S Paulo - Brazil

How to get Outlook Inspector as IDispatch object from window handl

Postby VG9t » Sun, 10 Jan 2010 02:56:02 GMT

Hi,

I am able to get any window handle from Outlook. For each of these window 
handle I've tried AccessibleObjectFromWindow( hWnd, (DWORD)OBJID_NATIVEOM, 
IID_IDispatch, (void**)&pDispWindow); I am able to get Word.Document object 
from a window class as "_WwG". But I am not able to get Outlook.Inspedtor 
object from any of these window.

Is there any way to get Outlook.Inspedtor object from one of these window?

I am running Outlook 2007 and Outlook 2010. Developing language is C++.

Thanks in advance.

Tom



Similar Threads:

1.Get Inspector or MailItem as IDispatch object from a window handle

I am able to get any window handle from outlook. For each of these window 
handle I've tried AccessibleObjectFromWindow( hWnd, (DWORD)OBJID_NATIVEOM, 
IID_IDispatch, (void**)&pDispWindow); I am able to get Word.Document object 
from a window class as "_WwG". But I am not able to get Outlook.Inspedtor 
object from any of these window.

Is there any way to get Outlook.Inspedtor object from one of these window?

Thanks in advance.

Tom

2.How to get Inspector object from Window handle

Hi,

I post this question on Outlook-General and administrator suggest me putting 
here.

I am able to get any window handle from outlook. For each of these window 
handle I've tried AccessibleObjectFromWindow( hWnd, (DWORD)OBJID_NATIVEOM, 
IID_IDispatch, (void**)&pDispWindow); I am able to get Word.Document object 
from a window class as "_WwG". But I am not able to get Outlook.Inspedtor 
object from any of these window. 

Is there any way to get Outlook.Inspedtor object from one of these window? 

Thanks in advance. 

Tom 

3.IDispatch::Invoke pbs on outlook 97 objects

Hi,
I'm doing a plugin for outlook and i want it to work with 
outlook 2K, 2K2 and 97.
So far it works ont 2K & 2K2 but no in 97 because the 
MailItem object i use has changed .

So what i try to do is to use the IDispatch::Invoke 
function to dynamically call the right methods.

I invoke the save function like that and it work fine but 
then i try to invoke the GetSaveSentMessageFolder() but 
then the GetIDsOfNames function returns with a 
DISP_E_UNKNOWNNAME error which i guess means that the 
GetSaveSentMessageFolder function is not found somehow.
I checked in the msoutl8.tlh generated file and the method 
GetSaveSentMessageFolder do exists for the _DMailItem 
class.

here is my code. If anyone could help, it would be very 
much apreciated.

thanks.

//Here i get the type of my dispatch object
if (lpMyDispatch)
{
	//Get type information
	LPTYPEINFO lpMyTypeInfo = NULL;
	hr = lpMyDispatch->GetTypeInfo(0, 0, 
&lpMyTypeInfo);
	if (lpMyTypeInfo != NULL)
	{
		hr = lpMyTypeInfo->GetDocumentation
(MEMBERID_NIL, &szName, 0,	0, 0);
	}
}

//if its a _DMailItem, we're in outlook 97
if (0 == strcmp("_DMailItem",(char *) (_bstr_t)szName)) 
{
	HRESULT hr = NOERROR;
	DISPID dispid;
	DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
	OLECHAR FAR* pszMember = NULL;

	//Here i save my _DMailItem and it works fine
	pszMember = L"Save";
	hr = lpMyDispatch->GetIDsOfNames(IID_NULL, 
&pszMember, 1, LOCALE_USER_DEFAULT, &dispid);
	hr = lpMyDispatch->Invoke(
			dispid,
			IID_NULL, LOCALE_USER_DEFAULT, 
DISPATCH_METHOD,
			&dispparamsNoArgs, NULL, NULL, 
NULL);


/* ...... */


	VARIANT var;
	VariantInit(&var);
	//Here i try to get the sentFolder for outlouk by 
calling the GetSaveSentMessageFolder method
	//In the Msoutl8.tlh file it is defined like this :
	//__declspec(implementation_key(1227)) 
MAPIFolderPtr _DMailItem::GetSaveSentMessageFolder ( );
	pszMember = L"GetSaveSentMessageFolder";
	hr = lpMyDispatch->GetIDsOfNames(IID_NULL, 
&pszMember, 1, LOCALE_USER_DEFAULT, &dispid);
	// *** Here hr == DISP_E_UNKNOWNNAME
	hr = lpMyDispatch->Invoke(
			dispid,
			IID_NULL, LOCALE_USER_DEFAULT, 
DISPATCH_PROPERTYGET,
			&dispparamsNoArgs, &var, NULL, 
NULL);

	DISPPARAMS dispparamsMove;
	EXCEPINFO FAR *pExcepInfo;
	dispparamsMove.rgvarg[0].vt = var.vt;
	dispparamsMove.rgvarg[0].ppunkVal = var.ppunkVal;
	dispparamsMove.cArgs = 1;
	dispparamsMove.cNamedArgs = 0;

	pszMember = L"Move";
	hr = lpMyDispatch->GetIDsOfNames(IID_NULL, 
&pszMember, 1, LOCALE_USER_DEFAULT, &dispid);
	MessageBox(m_hWnd, "Apres GetIDsOfNames", ERREUR, 
MB_OK);
	hr = lpMyDispatch->Invoke(
			dispid,
			IID_NULL, LOCALE_USER_DEFAULT, 
DISPATCH_METHOD,
			&dispparamsMove, NULL, pExcepInfo, 
NULL);
	VariantClear(&var);
	MessageBox(m_hWnd, "Apres VariantClear", ERREUR, 
MB_OK);
}


4.IDispatch: Can I add a parameter to IDispatch GetIDsOfNames and In

Hi,

I want to make a call to IDispatch GetIDsofNames and IDispatch Invoke from 
one COM exe to another COM exe (in which the implementaion of these two 
methods is being done). The second COM exe is an automation wrapper. In doing 
so I want to pass an argument (BSTR) to IDispatch GetIDsOfNames and Invoke 
from the caller exe so that i can preserve my thread pool design. e.g I need 
to do the following

STDMETHOD (GetIDsOfNames)(REFIID riid, LPOLESTR* rgszNames, UINT cNames,LCID 
lcid,DISPID* rgdispid, BSTR sessionID );

STDMETHOD ( Invoke )( DISPID dispidMember, REFIID riid, LCID lcid, WORD 
wFlags, DISPPARAMS* pDispparams, VARIANT* pVarResult, EXCEPINFO* pExcepinfo, 
UINT* puArgErr, BSTR sessionID); 

Can some body tell me the exact signature to be used in my IDL for GetIDsOf 
Name and Invoke. 

5.Inspector windows Active and Deactive event for outlook 2003 (C++)

Hello I am developing Outlook Addin using ATL-COM. I want to capture 
inspector windows active and deactive/ close event. Where should i advise 
these event. Right  now I am adding button on NewInspector Event but if new 
inspector windows focus is lost then added button get deleted. any sample 
code / suggestion will be usefull

6. Outlook addin started directly by inspector window (c# .net 3.5)

7. IDispatch: Can an additional parameter added in IDispatch GetIDsOf

8. How to uniquely identify explorer / inspector objects in Outlook 2007



Return to Microsoft OFFICE

 

Who is online

Users browsing this forum: No registered users and 65 guest