Back to Devexpress

RangePermissionCollection.CreateRangePermission(DocumentRange) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-rangepermissioncollection-dot-createrangepermission-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-documentrange-x29.md

latest3.4 KB
Original Source

RangePermissionCollection.CreateRangePermission(DocumentRange) Method

Creates a RangePermission object for the specified range.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public RangePermission CreateRangePermission(
    DocumentRange range
)
vb
Public Function CreateRangePermission(
    range As DocumentRange
) As RangePermission

Parameters

NameTypeDescription
rangeDocumentRange

A DocumentRange object specifying a document range.

|

Returns

TypeDescription
RangePermission

A RangePermission object specifying editing permissions.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateRangePermission(DocumentRange) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

word-document-api-examples/CS/CodeExamples/ProtectionActions.cs#L101

csharp
// Specify the group of users and the user that are allowed to edit the document range.
RangePermission rp = rangePermissions.CreateRangePermission(document.Paragraphs[3].Range);
rp.Group = "Administrators";

word-document-api-examples/VB/CodeExamples/ProtectionActions.vb#L81

vb
' Specify the group of users and the user that are allowed to edit the document range.
Dim rp As DevExpress.XtraRichEdit.API.Native.RangePermission = rangePermissions.CreateRangePermission(document.Paragraphs(CInt((3))).Range)
rp.Group = "Administrators"

See Also

Restrictions and Protection

RangePermissionCollection Class

RangePermissionCollection Members

DevExpress.XtraRichEdit.API.Native Namespace