Outlook Voting Buttons

M

Marius

Hello,

Is it possible to answer automatically e.g. I get a message with two Buttons
Yes and No.

I want to answer with VBA the "Yes" Button.

Sincerely
Marius
 
D

Dmitry Streblechenko

Use the MailItemActions collection to retrieve the corresponding action and
call Action.Execute. For the voting style actions, it will return the new
mail item, all you need to do is send it (MailItem.Send)

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

Marius

Hello,

Thank you.

It works. But why I get two Security Dialogs?

....
Dim myItem2 As Outlook.MailItem

Set myItem2 = objAppt.Actions("Yes").Execute
myItem2.Send
......

What is wrong?

Sincerely,
Marius
 
D

Dmitry Streblechenko

Because Action.Execute and MailItem.Send raise the security prompts?
Are you running this code from Outlook VBA or something else (e.g. Excel
VBA)?

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

Marius

Yes from Access VBA.

Sincerely,
Marius



Dmitry Streblechenko said:
Because Action.Execute and MailItem.Send raise the security prompts?
Are you running this code from Outlook VBA or something else (e.g. Excel
VBA)?

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

Marius

I know the Outlook Redemption Library.

But is it possible with only on Security promt? Without use Redemption.
 
D

Dmitry Streblechenko

Redemption won't help with Action.Execute, so you only options are really
1. switch to Outlook 2007 and make sure the AV app is up to date
2. Disable the security prompts using the admin form
3. Run your code either as an Outlook COM add-in or in Outlook VBA.

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