Adding a BCC recipient

S

sallie

In Outlook XP I have created a custom form that includes
some checkboxes. I want to include an additional
recipient if one particular checkbox is checked, and only
if it is checked. I think I posted a question related to
this several months ago, but posts do not go back that
far for me to check. I have again been asked to try to
resolve this issue. I have a note I added to my
Jumpstart book that says "not in VBS"... I am assuming
that it was determined this cannot be done in a custom
form, but I want to verify that this is true before I
tell the requester that it cannot be done.
 
S

Sue Mosher [MVP]

You can get several years' worth of old posts at http://groups.google.com

You should be able to do this in a custom form. The brute force approach would be simply to set the Item.Bcc property. However, that would overwrite any existing Bcc recipent information. The refined approach would be to use Item.Recipients.Add, but tht will trigger security prompts unless your Exchange administrator has loosened the "object model guard."

Your choice.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

sallie

Thanks for the archive information, I found my original
post back in April... good to know that source is out
there.
My question now that I know it can be done, albeit a bit
differently in VBS... using the Event Handler I can come
up with a structure, but I do not know how to apply it to
my code. In the following code which is mostly from the
help files, all of the "my" items have to be something in
my Outlook, how do I know what folder is myFolder... My
checkbox is the ckPolycom, that is the only item that is
identified to my form... potentially can this work if I
get all the items identified correctly?

Function Item_Forward(ByVal ForwardItem)
If ckPolycom = True Then
Set myNameSpace = Application.GetNameSpace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(6)
Set myForward = myFolder.Items(1).Forward
myForward.Recipients.Add "susan.jones"
myForward.Send
End If
End Function



-----Original Message-----
You can get several years' worth of old posts at http://groups.google.com

You should be able to do this in a custom form. The
brute force approach would be simply to set the Item.Bcc
property. However, that would overwrite any existing Bcc
recipent information. The refined approach would be to
use Item.Recipients.Add, but tht will trigger security
prompts unless your Exchange administrator has loosened
the "object model guard."
 
S

Sue Mosher [MVP]

Now I'm confused. What do folders and forwarding have to do with it? I thought you just wanted to add a recipient (Bcc? Cc? To?) to the current item before it goes out?

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP]

Try this, adjusting the names of the page and the check box control to match those on your form:

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

You should use the SMTP address for the recipient you want to add, to make sure that Outlook resolves it automatically. Also, you can expect to get security prompts; see http://www.slipstick.com/outlook/esecup.htm#autosec for your options if you want to avoid them.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
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