MailItem.Permission Property

Outlook Developer Reference

Sets or returns an OlPermission constant that determines the permissions the recipients will have on the e-mail item. Read/write.

Syntax

expression.Permission

expression   A variable that represents a MailItem object.

Remarks

Currently, setting the Permission property of a MailItem to olPermissionTemplate is not supported and will cause Outlook to display an error.

While you can view content that is protected by Information Rights Management (IRM) on any computer running 2007 Microsoft Office system, you must have Microsoft Office Professional 2007, Microsoft Office Outlook 2007, or Microsoft Office Professional Edition 2003 to create or send an e-mail that is protected by IRM.

Example

This Microsoft Visual Basic for Applications (VBA) example uses the Send event and sends an item with a 'Do not forward' restriction. The sample code must be placed in a class module such as ThisOutlookSession, and the SendMyMail procedure must be called before the event procedure can be called by Microsoft Outlook. Replace 'Dan Wilson' with a valid recipient name before running this example.

Visual Basic for Applications
  Public WithEvents myItem As Outlook.MailItem
  
Sub SendMyMail()
    Set myItem = Outlook.CreateItem(olMailItem)
    myItem.To = "Dan Wilson"
    myItem.Subject = "Data files information"
    myItem.Send
End Sub

Private Sub myItem_Send(Cancel As Boolean) myItem.Permission = olDoNotForward End Sub

See Also