Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<None Update="Data\Template.docx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
using Syncfusion.DocIO.DLS;

// Loads a template document
WordDocument document = new WordDocument(Path.GetFullPath(@"Data/Template.docx"));
// Gets the document text
string text = document.GetText();
// Prints the extracted text to the console
Console.WriteLine(text);
// Dispose the document instance
document.Close();
using (WordDocument document = new WordDocument(Path.GetFullPath(@"Data/Template.docx")))
{
// Get the document text
string text = document.GetText();

// Save the text to a file
string outputPath = Path.GetFullPath(@"Output/Output.txt");
File.WriteAllText(outputPath, text);
}
Loading