command buttons in outlook forms

P

prerak.bathia

I am having trouble using a command button for a post/mail form. I
would like the command button to send an email to a desired address in
the address book. When I use the [to] value, it only brings up the
address book. I am unfamiliar with VBA script to creat this. Please
help.

Prerak
 
H

Hollis Paul [MVP - Outlook]

I am having trouble using a command button for a post/mail form. I
would like the command button to send an email to a desired address in
the address book. When I use the [to] value, it only brings up the
address book. I am unfamiliar with VBA script to creat this. Please
help.
When you are setting up an address programmatically, you do not access
the [to] field. Instead, you add a recipient object to the recipients
collection of the item. You set the recipient object to type To, add
the email address, and the message will be sent to that email address.
You can find out all you need to know from the Outlook Object Model, and
the help icons in the Outlook Code page, and the Object browser
(available from the F2 key). But it takes considerable work to learn
your way around all these objects, help fields, etc. So, to reduce the
frustration go to www.outlookcode.com and search on "recipient", without
the quotes, and you will find an example of how to do this.

This isn't quite what you want, but close:

To automatically add an e-mail address as a Bcc to all outgoing messages
in Microsoft Outlook 2000 or later versions 5/10/2006

http://www.outlookcode.com/d/code/autobcc.htm - 18 KB
 

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