PDA

View Full Version : Solved: Hide the bcc box in email



Gil
02-02-2011, 05:16 AM
Hello
I use the following part of code for sending an outlook email with an Excel attachment. The email opens from a command in excel and attaches itself to the email. All works perfectly but what I want now is for the .bcc box to be hidden on the ougoing email. Any suggestions would be greatly appreciated


With EmailItem
.Subject = Range("c28")
.Body = "" & vbCrLf
.To = Range("f4") 'or cell reference
.cc = Range("f6") 'or cell reference
.bcc = Range("f8") 'or cell reference
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
.display 'Send
End With

JP2112
02-02-2011, 08:20 AM
Outlook version?

If 2003, before displaying the email, hide the BCC field like this:

EmailItem.GetInspector.CommandBars("Menu Bar").Controls("View").Controls("Bcc Field").Execute

Gil
02-02-2011, 09:00 AM
Hello JP2112
I entered your line after my code and it works ok hiding the bcc to the sender of the email and of course the receiver will not see it any way.
However if the sender looks in his sent email's it is displayed there. Any way round this or alternative is to permanently delete that mail item after sending.
Outlook version 2007

Gil
:think:

JP2112
02-02-2011, 10:26 AM
I realize it's none of my business, but what you're trying to do sounds extremely shady.

You want certain emails to BCC someone, attachments and all, then go to great lengths to hide that fact from the unwitting sender.

Sorry, but even if you delete the email after sending, or remove the BCC from the sent message (both methods are possible), I can still press Alt+F11 and look at your code and see what you are doing. And of course I can simply go to View > Bcc Field to display the field at any time.

So really there's no way to hide this behavior from the end user using VBA.

Gil
02-02-2011, 12:18 PM
Hello JP2112
Now that you put it that way I can see why it sounds shady. I can assure you that it is not intended that way ( I know you don't know me from Adam). The set up I am using is only that a user fills in a form with non personal information, only work related job reports. The .bcc was only to go to the co-developer of my project which in this case was to be as discreet as possible.
Many thanks for your help and support and I want to make it clear that I do not want to compromise any ethics associated with the excellent work and advice freely given by all contributors at vbaexpress.
Thank you
Gil

JP2112
02-02-2011, 01:18 PM
I understand, but I maintain that using VBA there is no way to truly hide the BCC.

Even if you exhaust all methods, I can still unhide the BCC field or look at the VBA code and see what is going on.

You're better off just telling your end users what you're up to, so they won't remove the BCC. A little social engineering, if you catch my drift.