option buttons

  • Thread starter Thread starter gm
  • Start date Start date
G

gm

I have two option buttons in a form. One button is
OPB_L the other is
OPB_M

If the user selects one or both of these buttons I want an
e-maill address to fill in the to field. How do you do
this?


Thanks
in advance
 
You'll need to tell us more:

-- Do you want the address to be appended to the To field or to replace any
addresses already in the To field?

-- Do you want to store the user's choice from those option buttons in the
item? Or do you need the information just temporarily to set the address?

In the meantime, see http://www.outlookcode.com/d/formcontrols.htm for
option button basics.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



I have two option buttons in a form. One button is
OPB_L the other is
OPB_M

If the user selects one or both of these buttons I want an
e-maill address to fill in the to field. How do you do
this?


Thanks
in advance
 
I want to have the addresses added to the to field. There
will only be two names to select from. If the user selects
both then both of them will go into the To field. I just
need the information for this one area. It will not be
used in the message or in the body.

Thanks

Sue were can I get your book?

-----Original Message-----
You'll need to tell us more:

-- Do you want the address to be appended to the To field or to replace any
addresses already in the To field?

-- Do you want to store the user's choice from those option buttons in the
item? Or do you need the information just temporarily to set the address?

In the meantime, see
http://www.outlookcode.com/d/formcontrols.htm for
 
In that case, I would use checkboxes, not option buttons, and code something
like this: You'll have to make the page and control names match those in
your form, of course:

Sub chkAddress1_Click()
Call SetTo
End Sub

Sub chkAddress2_Click()
Call SetTo
End Sub

Sub SetTo()
Set objPage = Item.GetInspector.ModifiedFormPages("Message")
Set chkAddress1 = objPage.Controls("chkAddress1")
Set chkAddress2 = objPage.Controls("chkAddress2")
strTo = ""
If chkAddress1.Value = True Then
strTo = "(e-mail address removed)"
End If
If chkAddress2.Value = True Then
strTo = strTo & ";" & "(e-mail address removed)"
End If
Item.To = strTo
End Sub

My book is available through Amazon.com and other online retailers, or you
can ask your local bricks-and-mortar store to order it for you if they don't
have it on the shelf.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


I want to have the addresses added to the to field. There
will only be two names to select from. If the user selects
both then both of them will go into the To field. I just
need the information for this one area. It will not be
used in the message or in the body.

Thanks

Sue were can I get your book?

-----Original Message-----
You'll need to tell us more:

-- Do you want the address to be appended to the To field or to replace any
addresses already in the To field?

-- Do you want to store the user's choice from those option buttons in the
item? Or do you need the information just temporarily to set the address?

In the meantime, see
http://www.outlookcode.com/d/formcontrols.htm for
 
Back
Top