Push Receive/Send button

  • Thread starter Thread starter cyan21
  • Start date Start date
C

cyan21

hello,

I'd like to launch the reception of mails by code but I don't know how
to access to the button Receive/Send.

I used a class Wizard to extract type from the Outlook typelib but
there is no class for CommandBar.

So how do you do to access it ?

thank in advance

yann.
 
CommandBar related functionality is shared by all Office apps. The type
library you need is MSO.DLL

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
thanks a lot.

I managed to get the button.

but now I have another problem.
I'm trying to create a new appointment and to display it.

CComPtr<Outlook::_AppointmentItem> appt;
COleVariant v1;
v1.iVal = 1;
v1.vt = VT_I4;

hr = m_pApp.CoCreateInstance(__uuidof(Outlook::Application), NULL,
CLSCTX_SERVER);

m_pApp->CreateItem(Outlook::olAppointmentItem, (IDispatch**)&appt);
appt->Display(v1);

the error occured when I created the appointment and it says that the
function CreateItem doesn't take 2 parameters whereas when I write the
name of the function to see the parameters, it shows me it takes 2.

I don't understand.......
 
Can't help you with thaa, sorry - I don't use C++.
Did you try to use only one parameter and assign the CreateItem function
result to the appt variable?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Yes I tried it but the CreateItem function returns a HRESULT type and
not a IDispatch type.

if someone find a solution, let me hear it. I'll post here if I find
one.
 
Back
Top