Push Receive/Send button

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.
 
D

Dmitry Streblechenko

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
 
C

cyan21

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::blush:lAppointmentItem, (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.......
 
D

Dmitry Streblechenko

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
 
C

cyan21

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top