Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I have the below VBA to send mail from outlook but I am unable to figure out the piece of code that would select the 'classification: Restricted' (This add in was developed by client and the add in called as IC labeeling addin and added to outlook Ribbon).

Can some one please help me with the code, to select the value from outlook Ribbon?


Thanks in Advance.

What I have tried:

VB
Sub CreateMail()
    Dim rng As Range
    rowN = ThisWorkbook.Sheets("Impact Analysis").Cells(Rows.Count, 7).End(xlUp).Row
    Set rng = ThisWorkbook.Sheets("Impact Analysis").Range("C6:G" & rowN)
    Dim OutApp
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    With OutMail
        .To = "karthickonmail@gmail.com"
        '.CC = ""
        '.BCC = ""
        .Subject = "Table change impact please review."

        .HTMLBody = "The below changes has been made to the tables,please perform the regression testing" & vbCrLf & RangetoHTML(rng) _
        & vbCrLf & "Reason for Change:"

        .Send
    End With
Posted
Updated 14-May-17 21:48pm
v2

1 solution

You may use the PropertyAccessor of Outlook's object model like this:

VB
Set oPA = oMail.PropertyAccessor 
 oPA.SetProperty myProp, myValue


I just don't know the value for the 'restricted' property but if you first create a mail with this property and then read the list of assigned properties, you'll find the required value. Maybe it is combined within the 'flags' property - in this case it may be a little more difficult to separate it.

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900