Get Started
Documentation

GetLock

GetLock() → { SdtLock }

Get the lock type of this container

Parameters:

This method doesn't have any parameters.

Returns:

Type
SdtLock

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oBlockLvlSdt = Api.CreateBlockLvlSdt();
oBlockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control with the content lock set to it.");
oBlockLvlSdt.SetLock("sdtContentLocked");
oDocument.AddElement(0, oBlockLvlSdt);
oLock = oBlockLvlSdt.GetLock();
oParagraph = oDocument.GetElement(1);
oParagraph.AddText("Lock type: " + oLock);
builder.SaveFile("docx", "GetLock.docx");
builder.CloseFile();

Resulting document