Hello,
I have a file that generates an email, Outlook 365, with an attachement, but I would like to set the Encrypt Option to Do Not Forward. The line .PERMISSION = DoNotForward, doesn't seem to work. Any thoughts or suggestions on this?
My code.
Dim Sht As Excel.Worksheet
Set Sht = ThisWorkbook.ActiveSheet
Dim rng As Range
Set rng = Sht.Range("A5:J22")
rng.Copy
Dim OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim OutMail As Object
Set OutMail = OutApp.CreateItem(0)
Dim vInspector As Object
Set vInspector = OutMail.GetInspector
Dim wEditor As Object
Set wEditor = vInspector.WordEditor
With OutMail
.To = Trim(Range("A1").Value)
.CC = Trim(Range("A2").Value)
.Subject = Trim(Range("A3").Value)
--->> .Permission = donotforward
.display
wEditor.Paragraphs(2).Range.Paste
.attachments.Add Range("L1").Value
' .Options
End With
I have a file that generates an email, Outlook 365, with an attachement, but I would like to set the Encrypt Option to Do Not Forward. The line .PERMISSION = DoNotForward, doesn't seem to work. Any thoughts or suggestions on this?
My code.
Dim Sht As Excel.Worksheet
Set Sht = ThisWorkbook.ActiveSheet
Dim rng As Range
Set rng = Sht.Range("A5:J22")
rng.Copy
Dim OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim OutMail As Object
Set OutMail = OutApp.CreateItem(0)
Dim vInspector As Object
Set vInspector = OutMail.GetInspector
Dim wEditor As Object
Set wEditor = vInspector.WordEditor
With OutMail
.To = Trim(Range("A1").Value)
.CC = Trim(Range("A2").Value)
.Subject = Trim(Range("A3").Value)
--->> .Permission = donotforward
.display
wEditor.Paragraphs(2).Range.Paste
.attachments.Add Range("L1").Value
' .Options
End With