# Load password-protected documents Compare password-protected PDF, Word, Excel, or PowerPoint files by passing LoadOptions.Password for both source and target documents in GroupDocs.Comparison for .NET. [GroupDocs.Comparison](https://products.groupdocs.com/comparison/net) allows you to compare documents that are protected with a password. To compare password-protected documents, follow these steps: 1. Instantiate the [LoadOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/loadoptions) object. Specify source document password; 2. Instantiate the [Comparer](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer) object. Specify the source document path or stream and [LoadOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/loadoptions) object created in the previous step. 3. Instantiate another [LoadOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/loadoptions) object. Specify target document password. 4. Call the [Add](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer/methods/add/index) method. Specify the target document path or stream and the [LoadOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/loadoptions) object created in the previous step. 5. Call the [Comparer](https://reference.groupdocs.com/comparison/net/groupdocs.comparison/comparer) method. The following code snippet shows how to compare password protected documents: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; // ... LoadOptions sourceLoadOptions = new LoadOptions(){ Password = "1234" }; using (Comparer comparer = new Comparer("source.docx", sourceLoadOptions)) { LoadOptions targetLoadOptions = new LoadOptions() { Password = "5678" }; comparer.Add("target.docx", targetLoadOptions); comparer.Compare("result.docx"); } ``` {{< /tab >}} {{< /tabs >}} ## See also - [Specify file type manually]({{< ref "comparison/net/advanced-usage/loading/specify-file-type-manually.md" >}}) - [Load custom fonts]({{< ref "comparison/net/advanced-usage/loading/load-custom-fonts.md" >}}) - [Compare documents]({{< ref "comparison/net/comparison-basic/compare-documents.md" >}}) - [Set password for output document]({{< ref "comparison/net/advanced-usage/saving/set-password-for-resultant-document.md" >}})