Outlook 2003 - Check box populates BCC field

G

Guest

Hi - I have searched all through outlookcode.com, this microsoft discussion
group, and via Google and cannot find an answer to this simple question. I'm
sure I'm just missing something! I would like to modify a current custom form
to have a check box which, when checked, populates the BCC field. I have
inserted the BCC field, which is currently blank, since the form should only
go to that one person IF the check box is checked. I have then set the BCC
field to non-visible, so the user cannot view it or remove the person's name.
Anyway, how do I insert the code for the checkbox to do what I specified
above, and what is the code? Thanks!
 
G

Guest

Thank you. In the meantime I found this code of Sue Mosher's, from another
discussion forum. It seems like this is what you are referencing below. My
only question is what do I put in between the "My Page" quotes? The name of
my form? (formname.oft)?

Function Item_Send()
Const olBcc = 3
Set objPage = Item.GetInspector.ModifiedFormPages("My Page")
Set myCheckBox = objPage.Controls("myCheckBox")
If myCheckBox.Value = True Then
Set objRecip = Item.Recipients.Add (e-mail address removed)
If objRecip.Resolve Then
objRecip.Type = olBcc
Else
MsgBox "Could not resolve Bcc recipient"
Item_Send = False
End If
End If
End Function
 
H

Hollis Paul [MVP - Outlook]

Hi - I have searched all through outlookcode.com, this microsoft discussion
group, and via Google and cannot find an answer to this simple question. I'm
sure I'm just missing something! I would like to modify a current custom form
to have a check box which, when checked, populates the BCC field. I have
inserted the BCC field, which is currently blank, since the form should only
go to that one person IF the check box is checked. I have then set the BCC
field to non-visible, so the user cannot view it or remove the person's name.
Anyway, how do I insert the code for the checkbox to do what I specified
above, and what is the code? Thanks!
You do not really want to muck with the BCC field, in this case. What you want
to do is, if a button is clicked, add a Recipient Object, of type BCC, to the
Recipients collection. You will have to use the Object viewer and the help
button to find the value of BCC type parameter from the Outlook Object Model.

So, what you should be looking for on outlookcode.com is how to add a recipient
object to the recipients collection object. You should have more success when
you search on those terms.
 
H

Hollis Paul [MVP - Outlook]

My
only question is what do I put in between the "My Page" quotes? The name of
my form? (formname.oft)?
Not the name of the form, but the name on the tab that is used to select the
"page" that contains the checkbox control in your custom form. You may not
have noticed that you can change the p2, p3, p4 on the unused tabs to names of
your own choice. You customization should never go on the first tab, which is
already set up with the builtin functions of the form.
 

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