StoreLicenses Property

Microsoft Office Visual Basic

StoreLicenses Property

Returns a Boolean value that indicates whether the user's license to view the active document should be cached to allow offline viewing when the user cannot connect to a rights management server. Read/write Boolean. Default is True.

expression.StoreLicenses

expression    Required. An expression that returns a Permission object.

Remarks

The StoreLicenses property corresponds to (and its value is the opposite of) the Require a connection to verify a user's permission option in the permissions user interface. When StoreLicenses is False, users other than the document owner must connect to the rights management server and acquire the license to work with the document each time they open it.

When content is protected using the Microsoft Office 2003 Information Rights Management service, the StoreLicenses property is always True and cannot be set to False.

Example

The following example displays information about the permissions settings of the active document, including the StoreLicenses setting.

        Dim irmPermission As Office.Permission
    Dim strIRMInfo As String
    Set irmPermission = ActiveWorkbook.Permission
    If irmPermission.Enabled Then
        strIRMInfo = "Permissions are restricted on this document." & vbCrLf
        strIRMInfo = strIRMInfo & " View in trusted browser: " & _
            irmPermission.EnableTrustedBrowser & vbCrLf & _
            " Document author: " & irmPermission.DocumentAuthor & vbCrLf & _
            " Users with permissions: " & irmPermission.Count & vbCrLf & _
            " Cache licenses locally: " & irmPermission.StoreLicenses & vbCrLf & _
            " Request permission URL: " & irmPermission.RequestPermissionURL & vbCrLf
        If irmPermission.PermissionFromPolicy Then
            strIRMInfo = strIRMInfo & " Permissions applied from policy:" & vbCrLf & _
            "  Policy name: " & irmPermission.PolicyName & vbCrLf & _
            "  Policy description: " & irmPermission.PolicyDescription
        Else
            strIRMInfo = strIRMInfo & " Custom permissions applied."
        End If
    Else
        strIRMInfo = "Permissions are NOT restricted on this document."
    End If
    MsgBox strIRMInfo, vbInformation + vbOKOnly, "IRM Information"
    Set irmPermission = Nothing