How to retain the existing protection password on the word doc?

How to retain the existing protection password on the word doc? I see that Document.Protect method can be used to protect a word doc from changes. However how could I retain the existing protecting password applied earlier?
(Aspose.Words.dll Version: 8.2.0)

Hi,

Thanks for your inquiry. Please use the latest version of Aspose.Words for .NET and use the following code snippet for your requirement.

I suggest you to read following documentation links for your kind reference.
https://reference.aspose.com/words/net/aspose.words.saving/docsaveoptions
https://reference.aspose.com/words/net/aspose.words.saving/ooxmlsaveoptions

LoadOptions loadoption = new LoadOptions();
loadoption.Password = "test";
Document doc = new Document(MyDir + "in.doc", loadoption);
DocSaveOptions options = new DocSaveOptions(SaveFormat.Doc);
options.Password = "test";
doc.Save(MyDir + "AsposeOut.doc", options);