The following example demonstrates how to load and save Word document of any supported type.
```
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions();
Watermarker watermarker = new Watermarker("D:\\input.doc", loadOptions);
// Use add method to add watermark to a particular or all sections.
// Save changes.
watermarker.save("D:\\output.doc");
watermarker.close();
```
public final WordProcessingSectionCollection getSections()
Gets the collection of all sections of this [WordProcessingContent](../../com.groupdocs.watermark.contents/wordprocessingcontent).
Returns:WordProcessingSectionCollection - The collection of all sections of this [WordProcessingContent](../../com.groupdocs.watermark.contents/wordprocessingcontent).
public final void protect(int protectionType, String password)
Protects the document from changes and sets a protection password.
To have the content of the document editable use appropriate method of adding watermark with
[WordProcessingLockType.AllowOnlyFormFields](../../com.groupdocs.watermark.options/wordprocessinglocktype#AllowOnlyFormFields) or
[WordProcessingLockType.ReadOnlyWithEditableContent](../../com.groupdocs.watermark.options/wordprocessinglocktype#ReadOnlyWithEditableContent) parameter.
Parameters:
Parameter
Type
Description
protectionType
int
The protection type for the document.
password
java.lang.String
The password to protect the document with.
unprotect()
public final void unprotect()
Removes protection from the document regardless of the password.