Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / October 2006

Tip: Looking for answers? Try searching our database.

Initial Value of Recipient Field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dorci - 23 Oct 2006 18:59 GMT
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
Sue Mosher [MVP-Outlook] - 23 Oct 2006 19:58 GMT
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 
Signature

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
 

>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
[quoted text clipped - 9 lines]
> Thanks in advance,
> Dorci
Dorci - 24 Oct 2006 21:16 GMT
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?

> 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.
>
[quoted text clipped - 12 lines]
> > Thanks in advance,
> > Dorci
Dorci - 24 Oct 2006 21:28 GMT
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.

> 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
[quoted text clipped - 21 lines]
> > > Thanks in advance,
> > > Dorci
Sue Mosher [MVP-Outlook] - 24 Oct 2006 21:32 GMT
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

Signature

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
 

> 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
[quoted text clipped - 8 lines]
>>
>> 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 

>>    
>> >I have a combo box on a custom email form, offering a choice of 4 names.  I
[quoted text clipped - 10 lines]
>> > Thanks in advance,
>> > Dorci
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.