We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DocumentHandler().AddPassword not works

I am using below code to add password to word documents. it works before but recently it is throwing a exception. on DocumentHandler().AddPassword
this is the exception

Could not load type 'Aspose.Words.LoadOptions' from assembly 'Aspose.Words, Version=22.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56'.

Could not load type 'Aspose.Words.LoadOptions' from assembly 'Aspose.Words, Version=22.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56'.

here is the my code

using (FileStream fs = new FileStream(FilePath, FileMode.Open))
{
    AddPasswordOptions options = new AddPasswordOptions(FileFormat.Docx, Password);
    GroupDocs.Merger.Domain.Result.DocumentResult result = new DocumentHandler().AddPassword(fs, options);

    fs.Close();
    Stream documentStream = result.Stream;
    var filestream = File.Create(OutputPath);

    documentStream.CopyTo(filestream);
    documentStream.Close();
    filestream.Close();
}

Please help me on this

Thanks
Tilanka

This topic has been moved to the related forum: https://forum.groupdocs.com/t/documenthandler-addpassword-not-works/12135