SetAnyoneType

function SetAnyoneType(protectedRangeUserType: ProtectedRangeUserType = null): bool

Description

Sets the type of the "Anyone" user to the current protected range.

Parameters

protectedRangeUserTypeProtectedRangeUserTypedefault: null

The user type of the protected range.

Returns

bool

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddProtectedRange("protectedRange", "Sheet1!$A$1:$B$1");
var protectedRange = oWorksheet.GetProtectedRange("protectedRange");
protectedRange.SetAnyoneType("CanView");

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).