forked from SyncfusionExamples/DocIO-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed35e09
commit 2099cb0
Showing
6 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
Find-and-Replace/Replace-misspelled-word/.NET/Replace-misspelled-word/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...-Word-document-with-password/.NET/Encrypt-Word-document-with-password/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...cryption-from-Word-document/.NET/Remove-encryption-from-Word-document/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Decrypt Word document using C# | ||
|
||
The Syncfusion [.NET Word Library](https://www.syncfusion.com/document-processing/word-framework/net/word-library) (DocIO) enables you to create, read, and edit Word documents programmatically without Microsoft Word or interop dependencies. Using this library, you can **decrypt Word documents** using C#. | ||
|
||
## Steps to decrypt a Word document programmatically | ||
|
||
Step 1: Create a new .NET Core console application project. | ||
|
||
Step 2: Install the [Syncfusion.DocIO.Net.Core](https://www.nuget.org/packages/Syncfusion.DocIO.Net.Core) NuGet package as a reference to your project from [NuGet.org](https://www.nuget.org/). | ||
|
||
Step 3: Include the following namespaces in the Program.cs file. | ||
|
||
```csharp | ||
using Syncfusion.DocIO; | ||
using Syncfusion.DocIO.DLS; | ||
using System.IO; | ||
``` | ||
|
||
Step 4: Add the following code snippet in Program.cs file to decrypt a Word document. | ||
|
||
```csharp | ||
using (FileStream fileStream = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.ReadWrite)) | ||
{ | ||
//Opens an encrypted Word document. | ||
using (WordDocument document = new WordDocument(fileStream, "syncfusion")) | ||
{ | ||
//Removes encryption in Word document. | ||
document.RemoveEncryption(); | ||
//Creates file stream. | ||
using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite)) | ||
{ | ||
//Saves the Word document to file stream. | ||
document.Save(outputStream, FormatType.Docx); | ||
} | ||
} | ||
} | ||
``` | ||
|
||
More information about the encrypt and decrypt options can be found in this [documentation](https://help.syncfusion.com/document-processing/word/word-library/net/working-with-security) section. |
6 changes: 3 additions & 3 deletions
6
Word-document/Split-by-heading/.NET/Split-by-heading/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters