Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Creating Accept/Reject sort of functionality on Mail Messages

Geek News

Creating Accept/Reject sort of functionality on Mail Messages
"Mohit" <mohitscjain[ at ]gmail.com> 3/5/2007 12:38:05 PM
Hi,

I wanted to create and program Accept/Reject (of Meeting Request
type) sort of buttons but these buttons will be on my HTML mail
messages. I mean when recipient opens my mail message he will be
presented with mail message body and at the bottom my buttons will be
there inside the mail Item.(This sort of functionality is common when
using Meeting Request Items. But I want this to work with Mail
Item.).

For this I am adding the necessary HTML button logic in the mail
item's HtmlBody.
On doing this buttons are appearing when my mail is opened but they
are not working.

On right click and going to view source option I am getting correct
logic there that i have inserted. And when this View Source Code is
runned in IE as a different html page it works!!! but not inside
Outlook environment. And I want it to work inside Outlook.

For information I am developing an Outlook Addin using VSTO 2005 SE
and Outlook 2003.

Help appreciated on how to achieve this.
Some other approaches other than using HtmlBody property is also
invited.
Thanks in advance.

Re: Creating Accept/Reject sort of functionality on Mail Messages
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 3/5/2007 1:54:53 PM
Outlook doesn't run code in HTML message bodies, by default. This needs to be done with voting buttons, not HTML code, and will work only with Outlook recipients. Use the Options dialog to create whatever voting buttons you want, or to do it programmatically, use the Actions collection.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Mohit" <mohitscjain[ at ]gmail.com> wrote in message news:1173098285.845073.124920[ at ]30g2000cwc.googlegroups.com...
[Quoted Text]
> Hi,
>
> I wanted to create and program Accept/Reject (of Meeting Request
> type) sort of buttons but these buttons will be on my HTML mail
> messages. I mean when recipient opens my mail message he will be
> presented with mail message body and at the bottom my buttons will be
> there inside the mail Item.(This sort of functionality is common when
> using Meeting Request Items. But I want this to work with Mail
> Item.).
>
> For this I am adding the necessary HTML button logic in the mail
> item's HtmlBody.
> On doing this buttons are appearing when my mail is opened but they
> are not working.
>
> On right click and going to view source option I am getting correct
> logic there that i have inserted. And when this View Source Code is
> runned in IE as a different html page it works!!! but not inside
> Outlook environment. And I want it to work inside Outlook.
>
> For information I am developing an Outlook Addin using VSTO 2005 SE
> and Outlook 2003.
>
> Help appreciated on how to achieve this.
> Some other approaches other than using HtmlBody property is also
> invited.
> Thanks in advance.
>
Re: Creating Accept/Reject sort of functionality on Mail Messages
"Mohit" <mohitscjain[ at ]gmail.com> 3/6/2007 12:07:14 PM
Thanks for immediate reply.
Now I want to know that how can I perform my logic (say database
entry) to be executed on that button click.
I want to write routine like click event handling for that voting
button. How can I do that?

Re: Creating Accept/Reject sort of functionality on Mail Messages
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 3/6/2007 12:39:27 PM
The event to use is MailItem.CustomAction, which fires when the user clicks a voting button and passes as parameters the Action and the response item that it creates.

Are you planning to install your addin on each recipient's machine?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Mohit" <mohitscjain[ at ]gmail.com> wrote in message news:1173182834.268640.279460[ at ]30g2000cwc.googlegroups.com...
[Quoted Text]
> Thanks for immediate reply.
> Now I want to know that how can I perform my logic (say database
> entry) to be executed on that button click.
> I want to write routine like click event handling for that voting
> button. How can I do that?
>
"Mohit" <mohitscjain[ at ]gmail.com> wrote in message news:1173098285.845073.124920[ at ]30g2000cwc.googlegroups.com...
> Hi,
>
> I wanted to create and program Accept/Reject (of Meeting Request
> type) sort of buttons but these buttons will be on my HTML mail
> messages. I mean when recipient opens my mail message he will be
> presented with mail message body and at the bottom my buttons will be
> there inside the mail Item.(This sort of functionality is common when
> using Meeting Request Items. But I want this to work with Mail
> Item.).
>
> For this I am adding the necessary HTML button logic in the mail
> item's HtmlBody.
> On doing this buttons are appearing when my mail is opened but they
> are not working.
>
> On right click and going to view source option I am getting correct
> logic there that i have inserted. And when this View Source Code is
> runned in IE as a different html page it works!!! but not inside
> Outlook environment. And I want it to work inside Outlook.
>
> For information I am developing an Outlook Addin using VSTO 2005 SE
> and Outlook 2003.

Re: Creating Accept/Reject sort of functionality on Mail Messages
"Mohit" <mohitscjain[ at ]gmail.com> 3/8/2007 7:09:38 AM
CustomAction is working. Thanks again.
Yes I will install addin on each recipient's machine.

Now I have another problem that these voting buttons are not appearing
when the mail is opened to read. So how can I make it appear when the
mail Item containing it is opened. Is it so that I am missing
something?

Another point is when that mail is opened from my Sent items folder
the voting buttons are appearing and works as expected. But I also
want that when the voting button containing mail item is opened from
Sent Items folder it should not display the voting buttons(i.e. I
don't want them to work there). Voting buttons should appear only when
they are opened to read from the Inbox.

-Mohit

Re: Creating Accept/Reject sort of functionality on Mail Messages
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 5/7/2007 1:43:32 PM
Sorry for the delayed response.
[Quoted Text]
>
> Now I have another problem that these voting buttons are not appearing
> when the mail is opened to read. So how can I make it appear when the
> mail Item containing it is opened. Is it so that I am missing
> something?

Make sure the server isn't stripping TNEF content; see http://www.outlookcode.com/d/sendform.htm

> Another point is when that mail is opened from my Sent items folder
> the voting buttons are appearing and works as expected.

That's normal and expected.

> But I also
> want that when the voting button containing mail item is opened from
> Sent Items folder it should not display the voting buttons(i.e. I
> don't want them to work there). Voting buttons should appear only when
> they are opened to read from the Inbox.

The only way I know to do that would be to put code in the Item_Open event handler to hide the Response toolbar.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net