Log in

View Full Version : [SLEEPER:] BCC column in Sent items does not show BCC recipients in preview pane



SvenBlomme
02-27-2015, 08:29 AM
Hi,

I have added the BCC column in my sent items folder. It indeed pops up in my preview pane but the column stays empty. According to my colleague in the IT department, Office 2010 apparently does not support this visualization of the BCC recipients in the preview pane.

Is there any way in which I can still populate this column?

Thanks for your help!

skatonni
02-28-2015, 10:00 AM
This describes how to save the information. http://www.outlookcode.com/codedetail.aspx?id=766

"This VBA code sample is intended for use with sent messages, which don't readily give up their Bcc information to printing or saving. The trick is to copy the Bcc info to a custom Outlook property." You can display that column.

Drop the parts for printing.


Sub PrintWithBCC()
Dim objItem As Object
Dim objProp As Outlook.UserProperty
On Error Resume Next
' uses the GetCurrentItem function
' from http://www.outlookcode.com/codedetail.aspx?id=50
Set objItem = GetCurrentItem()
If objItem.MessageClass = "IPM.Note" Then
Set objProp = objItem.UserProperties("BCC List")
If objProp Is Nothing Then
Set objProp = objItem.UserProperties.Add("BCC List", olText, True)
End If
' next statement will trigger security prompt in Outlook 2000 & 2002
' consider using Redemption from http://www.dimastr.com/redemption/
objProp.Value = objItem.BCC
objItem.PrintOut
End If
Set objItem = Nothing
Set objProp = Nothing
End Sub

SvenBlomme
03-16-2015, 05:36 AM
Hi Skatonni,

I tried the above, made a few minor changes, but for some reason the BCC column still does not populate. some times it does, for a single email, and sometimes it does not. I have no clue why this is the case... I pasted my updated code below. Could you please take a quick look at this, and let me know what I am doing wrong?


Sub PrintWithBCC()
Dim objItem As Object
Dim objProp As Outlook.UserProperty
Dim objselection As Outlook.Selection
On Error Resume Next
Set objselection = ActiveExplorer.Selection
For Each objItem In objselection
Set objItem = GetCurrentItem()
If objItem.MessageClass = "IPM.Note" Then
Set objProp = objItem.UserProperties("BCC List")
If objProp Is Nothing Then
Set objProp = objItem.UserProperties.Add("BCC List", olText, True)
End If
objProp.Value = objItem.BCC
objItem.Save
End If
Next objItem
Set objItem = Nothing
Set objProp = Nothing
MsgBox ("done")
End Sub

Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
Set objApp = Nothing
End Function

Thanks a lot,
Sven

skatonni
03-16-2015, 10:17 AM
To debug, mouse-click anywhere in the code. Press F8 repeatedly to step through the code. http://www.cpearson.com/excel/DebuggingVBA.aspx



You are repeatedly using the first item in the selection.

Set objItem = GetCurrentItem() is not needed.


Sub PrintWithBCC()
Dim objItem As Object
Dim objProp As Outlook.UserProperty
Dim objselection As Outlook.Selection
' Do not use when you are debugging and rarely ever
' On Error Resume Next
Set objselection = ActiveExplorer.Selection
For Each objItem In objselection
Set objItem = GetCurrentItem()
Debug.Print objItem.Subject ' <----
If objItem.MessageClass = "IPM.Note" Then
Set objProp = objItem.UserProperties("BCC List")
If objProp Is Nothing Then
Set objProp = objItem.UserProperties.Add("BCC List", olText, True)
End If
objProp.Value = objItem.BCC
objItem.Save
End If
Next objItem
Set objItem = Nothing
Set objProp = Nothing
MsgBox "done"
End Sub

Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
Set objApp = Nothing
End Function


You should see a # button to wrap code tags around your code.