Condividi tramite


Permission Property

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

OlPermission can be one of the following:

  • olUnrestricted (0)
  • olDoNotForward (1)
  • olPermissionTemplate (2)

expression.Permission

*expression   * Required. An expression that returns one of the objects in the Applies To list.

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.

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

Applies to | MailItem Object