Initial Value of Recipient Field

G

Guest

I have a combo box on a custom email form, offering a choice of 4 names. I
have the initial value of the CC field set to equal the name selected in the
combo box. With "calculate this formula automatically" selected, the name
populates the CC field as it should, but you cannot add any other names; they
just disappear when you do. With "calculate...when I compose a new form"
selected, you can add other names, but it does fill in the initial name from
the combo box.

Is there a way to set an initial value in the CC field AND add more names at
runtime, if desired?

Thanks in advance,
Dorci
 
S

Sue Mosher [MVP-Outlook]

Think about your scenario: There is no "initial value" available to apply because the user has not yet selected any name from the combo box.

The solution, therefore, is to put code behind the form to add a new recipient using the Item.Recipients.Add method when the user makes a choice from the combo box. See http://www.outlookcode.com/d/propsyntax.htm
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Yes, I understand why it happens; I was just hoping for a workaround. I've
programmed a lot in Access, but this is my first time programming an Outlook
form. I'm guessing the code you're suggesting is:

CC.Add(varName) 'where varName is the value selected in the combo
box.

If that is correct, where exactly would I place this code?
 
G

Guest

Nevermind. I didn't see the link you provided below. I'll check that out
first and see how far I get. Thanks for your response.
 
S

Sue Mosher [MVP-Outlook]

Where the code goes depends on *when* you want the new recipient to be added. I don't have a clear picture of whether you expect the user to employ the combo box to add multiple names or just one. Other crucial information would be whether the combo box is bound to an Outlook property and if so, what property. The page I suggested earlier covers most of the possible cases.

BTW, the object browser is your friend: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic. You'll see there's no such thing as CC.Add and that the method is as I had it -- Recipients.Add

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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