Send meeting cancelation notice.

G

Guest

I'm trying to send meeting cancelation but it's not working. Any suggestions?

What the following does is send an update notice, but it doesn't say that
the meeting was cancelled and the invitee was not given a choice to delete
from their calendar.

Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olfolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olApptItems = olNS.GetDefaultFolder _
(olFolderCalendar).Items


strSearch = "Test Meeting Invitation"
MsgBox olApptItems.Find("[Subject] = """ & strSearch & """")

Set olCurrAppt = olApptItems.Find("[Subject] = """ & strSearch & """")
While TypeName(olCurrAppt) <> "Nothing"
olCurrAppt.MeetingStatus = olMeetingCanceled
olCurrAppt.Send
olCurrAppt.Delete
Set olCurrAppt = olApptItems.FindNext
Wend

Set olApptItems = Nothing
Set olCurrAppt = Nothing
Set olfolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
 
G

Guest

It's part of an Access database that I'm working on. I have a form with a
button that runs that code.

Dmitry Streblechenko said:
Where does that code run?

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

dbornt said:
I'm trying to send meeting cancelation but it's not working. Any
suggestions?

What the following does is send an update notice, but it doesn't say that
the meeting was cancelled and the invitee was not given a choice to delete
from their calendar.

Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olfolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olApptItems = olNS.GetDefaultFolder _
(olFolderCalendar).Items


strSearch = "Test Meeting Invitation"
MsgBox olApptItems.Find("[Subject] = """ & strSearch & """")

Set olCurrAppt = olApptItems.Find("[Subject] = """ & strSearch & """")
While TypeName(olCurrAppt) <> "Nothing"
olCurrAppt.MeetingStatus = olMeetingCanceled
olCurrAppt.Send
olCurrAppt.Delete
Set olCurrAppt = olApptItems.FindNext
Wend

Set olApptItems = Nothing
Set olCurrAppt = Nothing
Set olfolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
 
D

Dmitry Streblechenko

Did you add Outlook to the project references? Otherwise VBA will see
olMeetingCanceled as 0 (as converted from Empty) rather than 5.

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

dbornt said:
It's part of an Access database that I'm working on. I have a form with a
button that runs that code.

Dmitry Streblechenko said:
Where does that code run?

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

dbornt said:
I'm trying to send meeting cancelation but it's not working. Any
suggestions?

What the following does is send an update notice, but it doesn't say
that
the meeting was cancelled and the invitee was not given a choice to
delete
from their calendar.

Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olfolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olApptItems = olNS.GetDefaultFolder _
(olFolderCalendar).Items


strSearch = "Test Meeting Invitation"
MsgBox olApptItems.Find("[Subject] = """ & strSearch & """")

Set olCurrAppt = olApptItems.Find("[Subject] = """ & strSearch & """")
While TypeName(olCurrAppt) <> "Nothing"
olCurrAppt.MeetingStatus = olMeetingCanceled
olCurrAppt.Send
olCurrAppt.Delete
Set olCurrAppt = olApptItems.FindNext
Wend

Set olApptItems = Nothing
Set olCurrAppt = Nothing
Set olfolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
 
G

Guest

Yes I did. And I've ran the code step by step, and confirmed that the value
is 5 after it's set to olMeetingCanceled. And when at that moment I look at
my calendar, it says the meeting is canceled there.
How can I find out what events are triggered when I manually delete the
meeting?

Dmitry Streblechenko said:
Did you add Outlook to the project references? Otherwise VBA will see
olMeetingCanceled as 0 (as converted from Empty) rather than 5.

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

dbornt said:
It's part of an Access database that I'm working on. I have a form with a
button that runs that code.

Dmitry Streblechenko said:
Where does that code run?

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

I'm trying to send meeting cancelation but it's not working. Any
suggestions?

What the following does is send an update notice, but it doesn't say
that
the meeting was cancelled and the invitee was not given a choice to
delete
from their calendar.

Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olfolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olApptItems = olNS.GetDefaultFolder _
(olFolderCalendar).Items


strSearch = "Test Meeting Invitation"
MsgBox olApptItems.Find("[Subject] = """ & strSearch & """")

Set olCurrAppt = olApptItems.Find("[Subject] = """ & strSearch & """")
While TypeName(olCurrAppt) <> "Nothing"
olCurrAppt.MeetingStatus = olMeetingCanceled
olCurrAppt.Send
olCurrAppt.Delete
Set olCurrAppt = olApptItems.FindNext
Wend

Set olApptItems = Nothing
Set olCurrAppt = Nothing
Set olfolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
 
D

Dmitry Streblechenko

Hmmm... I can reproduce this, looks like an Outlook bug.
What's weird is that the meeting status MAPI property on the request in teh
Sent Items fodler is set to 7 rather than 5 (olMeetingCanceled)...

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

dbornt said:
Yes I did. And I've ran the code step by step, and confirmed that the
value
is 5 after it's set to olMeetingCanceled. And when at that moment I look
at
my calendar, it says the meeting is canceled there.
How can I find out what events are triggered when I manually delete the
meeting?

Dmitry Streblechenko said:
Did you add Outlook to the project references? Otherwise VBA will see
olMeetingCanceled as 0 (as converted from Empty) rather than 5.

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

dbornt said:
It's part of an Access database that I'm working on. I have a form
with a
button that runs that code.

:

Where does that code run?

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

I'm trying to send meeting cancelation but it's not working. Any
suggestions?

What the following does is send an update notice, but it doesn't say
that
the meeting was cancelled and the invitee was not given a choice to
delete
from their calendar.

Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olfolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olApptItems = olNS.GetDefaultFolder _
(olFolderCalendar).Items


strSearch = "Test Meeting Invitation"
MsgBox olApptItems.Find("[Subject] = """ & strSearch & """")

Set olCurrAppt = olApptItems.Find("[Subject] = """ & strSearch &
"""")
While TypeName(olCurrAppt) <> "Nothing"
olCurrAppt.MeetingStatus = olMeetingCanceled
olCurrAppt.Send
olCurrAppt.Delete
Set olCurrAppt = olApptItems.FindNext
Wend

Set olApptItems = Nothing
Set olCurrAppt = Nothing
Set olfolder = Nothing
Set olNS = Nothing
Set olApp = Nothing
 

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