Consulting

Results 1 to 4 of 4

Thread: BCC column in Sent items does not show BCC recipients in preview pane

  1. #1

    BCC column in Sent items does not show BCC recipients in preview pane

    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!

  2. #2
    VBAX Mentor skatonni's Avatar
    Joined
    Jun 2006
    Posts
    347
    Location
    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
    To debug, mouse-click anywhere in the code. Press F8 repeatedly to step through the code. http://www.cpearson.com/excel/DebuggingVBA.aspx

    If your problem has been solved in your thread, mark the thread "Solved" by going to the "Thread Tools" dropdown at the top of the thread. You might also consider rating the thread by going to the "Rate Thread" dropdown.

  3. #3
    Hi Skatonni,

    I tried the above, made a few minr changes, but for some reason the BCC column still does not populate. somteimes 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

  4. #4
    VBAX Mentor skatonni's Avatar
    Joined
    Jun 2006
    Posts
    347
    Location
    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.
    To debug, mouse-click anywhere in the code. Press F8 repeatedly to step through the code. http://www.cpearson.com/excel/DebuggingVBA.aspx

    If your problem has been solved in your thread, mark the thread "Solved" by going to the "Thread Tools" dropdown at the top of the thread. You might also consider rating the thread by going to the "Rate Thread" dropdown.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •