Link to home
Start Free TrialLog in
Avatar of doctorbill
doctorbillFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Outlook Visual Basic

I have the following code which is working perfectly:

Public Sub MakeThisConfidential()
Application.ActiveInspector.CurrentItem.Sensitivity = olConfidential
Application.ActiveInspector.CurrentItem.Save
' MyMsg = MsgBox(Prompt, 0, "This message has been marked Confidential and will be encrypted by Fusemail")
MyMsg = MsgBox("Click OK to accept status" & vbCrLf & "This will encrypt the Current Message using fusemail", 0, "This message has been marked Confidential")
End Sub

Sub ToggleSensitivity()
    If ActiveInspector.CurrentItem.Sensitivity = olConfidential Then
        ActiveInspector.CurrentItem.Sensitivity = olNormal
        MyMsg = MsgBox("Click OK to accept status" & vbCrLf & "This will NOT encrypt the Current Message using fusemail", 0, "This message has been marked Normal")
    Else
        ActiveInspector.CurrentItem.Sensitivity = olConfidential
        MyMsg = MsgBox("Click OK to accept status" & vbCrLf & "This will encrypt the Current Message using fusemail", 0, "This message has been marked as Confidential")
    End If
End Sub

Open in new window


I have attached it to 2 separate buttons
I want to be able to run the macros and change the current button image. The image is added by the outlook interface:
In the New Mail window:
File - Options - Customise Ribbon - Main Tabs - New Mail Message
There is a group in here which has buttons with the macro's attached
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

>>I have the following code which is working perfectly:

OK, so what is your question.
I want to be able to run the macros and change the current button image.
You can't do that with VBA (change button image). You'll need to write the add-in for that.
Avatar of doctorbill

ASKER

If I can't change the button image, how would I change the background colour of a new email message to light brown using VB
What I am after is to show that the email has been marked confidential after using one of the 2 scripts
Any other suggestions welcome
Changing the message background using VBA is a pretty tricky challenge: you'll need to modify the underlying HTML, I don't recommend this.

Please note that once you've set the Sensitivity to Confidential, you'll see the "Please treat this as Confidential" tip right below the message header. Also, you can add the "Sensitivity" column to the message list.
Sorry - I am using outlook 2016 and when I set the status to Confidential I do not see any "Please treat this as Confidential" tip
How do I add the Sensitivity column to the message list please
This is how Outlook 2016 shows the confidentiality:
User generated image
And to add the Sensitivity column, you need to customize the current folder view and add the Sensitivity column from "All Mail fields".
The confidential text shown above is shown up on the received email. I was meaning to show the email  is marked as confidential before it is sent - so the sender knows it is marked as confidential
You could add your own button to the ribbon - which you control text and image - specially for sending these confidential messages.
ASKER CERTIFIED SOLUTION
Avatar of Alexei Kuznetsov
Alexei Kuznetsov
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks all