Outlook 365 VBA permissions

bclever07

New Member
Joined
Feb 21, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
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
 

Forum statistics

Threads
1,226,841
Messages
6,193,287
Members
453,788
Latest member
drcharle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top