Sending appointment request

  • Thread starter Saurabh Aggarwal via OfficeKB.com
  • Start date
S

Saurabh Aggarwal via OfficeKB.com

Hi

Could you please give me some example of how can I programatically send
appointment to the attendees of a meeting that I have added to my outlook.
I want to send the appointment just like outlook sends it. The mail that is
send by the outlook have accept, decline etc kind of buttons. When user
(attendee) hits accept button meeting gets added to his outlook.



Regards

Saurabh
 
S

Saurabh Aggarwal via OfficeKB.com

I have no problem in adding appointment programatically in my outlook. May
I am not able to clear my problem. Suppose john have added some meeting in
his outlook in which I am one of the required attendees. I and john share
one common database. I saw that there is one meeting for me in the
database. now I just want to add that meeting in my outlook as if I have
clicked accept button of the mail send by the john.
Summary: I want add meeting in attendee outlook just like it gets added on
click of accept button of the meeting request mail.

Regards

saurabh
 
S

Sue Mosher [MVP-Outlook]

I'm not sure I understand the distinction. (Time for that 2nd cup of coffee, I guess.) You'd still have to add the appointment programmatically. Since you say you already know how to do that, what's missing from your approach?
 
S

Saurabh Aggarwal via OfficeKB.com

Ok! Let me change my question!
When we add an appointment to the outlook with one or more attendees, then
we can send email(to attendees) immediately at that time or we can just
save the appointment in our outlook (ie do not send any appointment email
to any of the attendee). Now my questions are
1. How can we determine for each appointment that currently there in
outlook, whether email had been sent to the attendees for this appointment
or not.
2. How can we send the meeting email to the attendees just like outlook
sends it during meeting creation.
 
S

Sue Mosher [MVP-Outlook]

1) There's no definitive way to know this. You can check the Sent Items folder, but the user could have deleted the sent message request. There are even scenarios where the user could delete it before it goes out to the recipients.

2) See http://www.outlookcode.com/codedetail.aspx?id=88 for a code sample that shows how to create a meeting request. Note that the Send statement is subject to Outlook security.
 
S

Saurabh Aggarwal via OfficeKB.com

Hi Sue

1. Is it a good approach to ascertain about sent status of appointment
request or just a patch.
Could you give me some example of enumerating through the sent folder so as
to found out whether meetng request email has been sent or not.

Regards

Saurabh
 
H

Henry Gusakovsky

Saurabh Aggarwal via OfficeKB.com said:
Ok! Let me change my question!
When we add an appointment to the outlook with one or more attendees, then
we can send email(to attendees) immediately at that time or we can just
save the appointment in our outlook (ie do not send any appointment email
to any of the attendee). Now my questions are
1. How can we determine for each appointment that currently there in
outlook, whether email had been sent to the attendees for this appointment
or not.
You can check named property

0x8229

const static MAPIUID APPOINTMENT_PROPS_GUID = {0x02, 0x20, 0x06, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0xC0, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x46 }; // Used in
appointment item properties. Message class:IPM.Appointment

type is PT_BOOLEAN

if this prop is true meeting mails has been sent.
2. How can we send the meeting email to the attendees just like outlook
sends it during meeting creation.

WBR
Henry
 
S

Saurabh Aggarwal via OfficeKB.com

Hi Henry

For this do we need to add reference to some dll. I think for this we need
to use CDO. Actully I don't want to use CDO because these may cause
security prompts to pop up. Could you please give me some C# code for
implemting this.

Regards
Saurabh
 
H

Henry Gusakovsky

I don't use C#

but some peace of code in C++

---------------- .h file ---------------
// Used in appointment item properties. Message class:IPM.Appointment
const static MAPIUID APPOINTMENT_PROPS_GUID = {0x02, 0x20, 0x06, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0xC0, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x46 };

static const MAPINAMEID OutlookNamedProp = {
(LPGUID)&APPOINTMENT_PROPS_GUID,
MNID_ID,
0x8229
};

static const LPMAPINAMEID OutlookNamedPropArray[1] = {
(LPMAPINAMEID)&OutlookNamedProp
};



------------------- .cpp file --------------------------



BOOL GetSent(LPMAPIPROP lpMAPIPropInterface)
{
BOOL bResult = FALSE;
HRESULT hResult = S_OK;

LPSPropTagArray lpNamedPropArray = NULL;

HRESULT hResult = lpMAPIPropInterface->GetIDsFromNames(
1,
(LPMAPINAMEID*)OutlookNamedPropArray,
MAPI_CREATE,
&lpNamedPropArray);

if(S_OK == hResult)
{

SizedSPropTagArray(1, sptaNamedProp) = {
1,
PR_ENTRYID // just init tag
};

sptaNamedProp.aulPropTag[0] = PROP_TAG(PT_BOOLEAN,
PROP_ID(lpNamedPropArray->aulPropTag[0]));

LPSPropValue lpNamedProp = NULL;
ULONG cValues = 1;
hResult = lpMAPIPropInterface->GetProps(
(LPSPropTagArray)&sptaNamedProp, 0, &cValues, &lpNamedProp);
if(S_OK == hResult)
{
bResult = lpNamedProp->Value.b;

MAPIFreeBuffer(lpNamedProp);
} // if


MAPIFreeBuffer(lpNamedPropArray);
} // if

return bResult;
}


WBR
Henry
 

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