SetLock
Set the lock to the current inline text content control.
"contentLocked" - content cannot be edited
"sdtContentLocked" - content cannot be edited and BlockLvlSdt cannot be deleted.
"sdtLocked" - BlockLvlSdt cannot be deleted.
Parameters:
Name |
Type |
Description |
sLockType |
"contentLocked" | "sdtContentLocked" | "sdtLocked"
|
The type of the lock applied to the inline text content control. |
Returns:
-
This method doesn't return any data.
Example
Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oInlineLvlSdt = Api.CreateInlineLvlSdt();
oParagraph.AddInlineLvlSdt(oInlineLvlSdt);
oRun = Api.CreateRun();
oRun.AddText("This is an inline text content control with the content lock set to it.");
oInlineLvlSdt.SetLock("sdtContentLocked");
oInlineLvlSdt.AddElement(oRun, 0);
builder.SaveFile("docx", "SetLock.docx");
builder.CloseFile();
Resulting document