VB .Net Add-in for Microsoft Outlook - Disable blank TO field chec

J

Jon Ebersole

I have successfully written an Add-In for Outlook 2003 using VB .Net.
Everything seems to be working well, except for one minor issue; I can't seem
to disable the send button's check for a blank to, cc, or bcc files within my
override of the Send event in a MailItem.

My application adds a command bar to the main Outlook menus. It has a single
button on it, that when clicked, creates a new MailItem. Within that new
MailItem, i want to be able to hit the send button, even if there are no
values in the to, cc, or bcc fields. By default, Outlook displays the
following error message...

There must be at least one name or distribution list in the To, CC, or BCC
box.

I want to disable or override the Send button and Send pull-down menu's
check for those fields not being blank. I can disable them and turn
visibility off and even add my own buttons to get around the issue, but I
don't want to do that.

Does anyone know how to disable this automatic check to see if the To, CC,
and BCC fields are blank within Outlook through code?
 
K

Ken Slovak - [MVP - Outlook]

As far as I know you can't do that. You need at least one recipient object.
 
J

Jon Ebersole

After doing some soul searching, to resolve (or workaround) the issue
mentioned in my original post, I did the following in my project...

- Add custom user properties and categories to any email messages created
using my add-in by...
- Overriding the Outlook Inspector's 'New Inspector' event to attach my user
properties and categories, add my buttons, and override the send button if
the TypeName(Inspector.CurrentItem) is MailItem (this will take care of all
newly created emails)
- Overriding the Outlook Inspector's 'Activate' event to attach my user
properties and categories, add my buttons, and override the send button if
the TypeName(objApplication.ActiveWindow) is Inspector AND if
TypeName(Inspector.CurrentItem) is MailItem (this will take care of
previously saved emails of our add-in type)
- When loading an email of our add-in type, put a fake email name in the TO
field (this is what keeps Outlook from displaying that message about not
having a recipient)
- When the user hits the Send button, our MailItem_Send event override
checks for our special user properties and categories and sets Cancel=False
to stop the emial from trying to be sent using BuiltIn Outlook.

Hopefully this info will help someone else...
 

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