Table of contents
TOC
Collapse the table of content
Expand the table of content

Permission.ApplyPolicy Method (Office)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Applies the specified permission policy to the active document.

Syntax

expression. ApplyPolicy( FileName )

expression A variable that represents a Permission object.

Parameters

NameRequired/OptionalData TypeDescription
FileNameRequiredStringThe path and filename of the permission policy template file.

Remarks

Microsoft Office Information Rights Management supports the use of administrative permission policies which list users and groups and their document permissions. The ApplyPolicy method applies a permission policy to the active document.

Example

The following example enables permissions on the active document and applies an administrative permission policy.

 Dim irmPermission As Office.Permission 
 Set irmPermission = ActiveWorkbook.Permission 
 Dim strIRMInfo As String 
 Select Case irmPermission.Enabled 
 Case True 
 strIRMInfo = "Permissions are already restricted on this document." 
 Case False 
 With irmPermission 
 .Enabled = True 
 .ApplyPolicy ("\\server\share\permissionpolicy.xml") 
 End With 
 strIRMInfo = "Permissions are now restricted on this document " & _ 
 vbCrLf & _ 
 " and the permission policy has been applied." 
 End Select 
 MsgBox strIRMInfo, vbInformation + vbOKOnly, "IRM Information" 
 Set irmPermission = Nothing 

See also

Concepts

Permission Object

Other resources

Permission Object Members

© 2018 Microsoft