API to lock a paragraph (readonly paragraph) in document

We would like to lock one or more paragraphs ie make it un editable before opening the document.

Hello @sukrutha.kini

In general, we are working on the support of Editing Restrictions feature that would allow natively blocking separate parts of the document from being edited.

As a workaround, you can develop a plugin that will wrap necessary paragraphs into Rich Text Content Control with Locking properties being set to Contents cannot be edited and Content control cannot be deleted. For that, you can check out following sample plugin that demonstrates how to create, remove and change Content Controls:

In addition, you can also set bounding box of these Content Controls to none to make them non-visible when user navigates through out the document.

I also would like to ask you to pay attention to the type of Content Control - Rich Text allows you to utilize whole paragraph for wrapping out instead of a part of the paragraph, which is possible with Inline Text Content Controls.

1 Like

By using the above approach, can we freeze/lock the header in a table ? User should not be able to change the column headers

Yes, if the text in the cells of your table are wrapped into a Content Control.