How do I add a Confidential button on the standard toolbar of an e-mail in Outlook?

Posted on 2006-05-26
Last Modified: 2006-11-18
If you open a new e-mail, then click View...Options, you will see a drop down for Sensitivity in the Message Settings section. In that drop down is an option for Confidential. Is there a way to add that option as a button on the toolbar?
Question by:itagent007
    LVL 9

    Expert Comment

    What Office version? OS?
    LVL 9

    Expert Comment

    Add a button, menu, or command
    Do one of the following:

    Add a button or menu to a toolbar

    On the View menu, point to Toolbars, and then click the toolbar you want to display.
    On the toolbar, click the Toolbar Options arrow .
    Point to Add or Remove Buttons, and then click Customize.
    Do one of the following:
    Add a button

    Click the Commands tab.
    In the Categories list, click a category for the command you want the button to perform.
    In the Commands list, click the command or macro you want and drag it to the displayed toolbar.
    Add a menu

    Click the Commands tab.

    In the Categories list, click New Menu.

    In the Commands list, click New Menu and drag it to the displayed toolbar.

    Right-click the new menu on the toolbar, type a name in the Name box on the shortcut menu, and then press ENTER.

    LVL 76

    Expert Comment

    by:David Lee
    Greetings, itagent007.

    The code below will add a toolbar button for making the message open in the window Confidential.  Follow these instructions to use it.
    1.  Start Outlook
    2.  Click Tools->Macros->Visual Basic Editor
    3.  If not already expanded, expand Microsoft Office Outlook Objects and select ThisOutlookSession
    4.  Copy the code in <First Code Block> and paste it into the right-hand pane of the VB editor
    5.  If not already expanded, expand Modules and select Module1.
    6.  Copy the code in <Second Code Block> and paste it into the right-hand pane of the VB editor
    7.  Click the diskette icon on the toolbar to save the code
    8.  Close the VB editor
    9.  Click Tools->Macros->Security
    10.  Change the security level to Medium
    11.  Click Ok
    12.  Close Outlook
    13.  Start Outlook
    14.  You'll receive a dialog-box telling you that ThisOutlookSession contains macros and asking if you want to enable them.  Click Enable Macros.
    15.  Create a new message.  You should see a button with a safe on it right next to the Options button.  Clicking it will make the message Confidential.

    '<First Code Block>
    Private WithEvents olkInspectors As Outlook.Inspectors, _
        WithEvents olkControl As CommandBarButton

    Private Sub Application_Quit()
        Set olkInspectors = Nothing
    End Sub

    Private Sub Application_Startup()
        Set olkInspectors = Application.Inspectors
    End Sub

    Private Sub olkInspectors_NewInspector(ByVal Inspector As Inspector)
        Dim olkBar As Office.CommandBar
        If Inspector.CurrentItem.Class = olMail And Not Inspector.CurrentItem.Sent Then
            Set olkBar = Inspector.CommandBars.Item("Standard")
            'Test to see if the toolbar button already exists
            Set olkControl = olkBar.FindControl(, , "Confidential")
            'If not found, then create button
            If olkControl Is Nothing Then
                Set olkControl = olkBar.Controls.Add(, , , 22, True)
                With olkControl
                    .OnAction = "MakeMessageConfidential"
                    .Caption = "Confidential"
                    .FaceId = 2654
                    .Style = msoButtonIcon
                    .Tag = "Confidential"
                    .TooltipText = "Set this message's sensitivity to Confidential"
                    .Visible = True
                End With
            End If
        End If
    End Sub
    '</First Code Block>

    '<Second Code Block>
    Sub MakeMessageConfidential()
        Application.ActiveInspector.CurrentItem.Sensitivity = olConfidential
    End Sub
    '</Second Code Block>

    LVL 1

    Author Comment

    Hey BlueDevilFan, you're the closest so far to get what I'm looking for. Is there any way though to not have a user be prompted to enable the macro so that the Confidential button visible? We have over 5,000 employees, and it would be best if this can be made seamless to the users. I just want to be able to open a new e-mail without having to be prompted.
    LVL 76

    Accepted Solution

    There are two ways to avoid the prompt for enabling macros.  One, set the macro security level to Low.  I don't recommend that since it leaves you vulnerable to Outlook based macro viruses and worms.  Two, sign the code.  Here's a link to instructions for doing that:
    LVL 1

    Author Comment

    Thanks for the help on us!

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
    Outlook Free & Paid Tools
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now