From 896e4d6d4dca3c06471f682efec2528146f59a25 Mon Sep 17 00:00:00 2001 From: Kathiresan4347 <159137198+Kathiresan4347@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:58:04 +0530 Subject: [PATCH 1/2] 1007016-Changes added --- .../Word-Library/NET/Support-File-Formats.md | 28 ++--- .../Word/Word-Library/NET/wordml.md | 107 ++++++++++++++++++ 2 files changed, 121 insertions(+), 14 deletions(-) create mode 100644 Document-Processing/Word/Word-Library/NET/wordml.md diff --git a/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md b/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md index eb8ea8627..a9e9284a1 100644 --- a/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md +++ b/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md @@ -19,25 +19,25 @@ The following table describes the supported file formats and their conversions i -{{'[DOC](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-binary-97-2003-format)'| markdownify }} +DOC -{{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#doc-to-docx-and-docx-to-doc)'| markdownify }} +{{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/open-and-save-word-document-in-console-application#open-and-save-word-document-using-net-core-and-latest)'| markdownify }} {{'[Word Processing XML (2007)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-open-xml-formats-2007--later)'| markdownify }} -{{'[DOT](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }} +DOT -{{'[DOTX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }} +DOTX -{{'[DOCM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }} +DOCM -{{'[DOTM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }} +DOTM {{'[ODT](https://help.syncfusion.com/document-processing/word/word-library/net/word-to-odt)'| markdownify }} @@ -62,7 +62,7 @@ The following table describes the supported file formats and their conversions i -{{'[DOC](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-binary-97-2003-format)'| markdownify }} +DOC Yes Yes Yes @@ -79,7 +79,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#doc-to-docx-and-docx-to-doc)'| markdownify }} +{{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/open-and-save-word-document-in-console-application#open-and-save-word-document-using-net-core-and-latest)'| markdownify }} Yes Yes Yes @@ -96,7 +96,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[Word Processing XML (2003)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-processing-xml-xml)'| markdownify }} +Word Processing XML (2003) Yes Yes Yes @@ -113,7 +113,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[Word Processing XML (2007)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-open-xml-formats-2007--later)'| markdownify }} +{{'[Word Processing XML (2007)]()'| markdownify }} Yes Yes Yes @@ -130,7 +130,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[DOT](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }} +DOT Yes Yes Yes @@ -147,7 +147,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[DOTX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }} +DOTX Yes Yes Yes @@ -164,7 +164,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[DOCM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }} +DOCM Yes Yes Yes @@ -181,7 +181,7 @@ The following table describes the supported file formats and their conversions i Yes -{{'[DOTM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }} +DOTM Yes Yes Yes diff --git a/Document-Processing/Word/Word-Library/NET/wordml.md b/Document-Processing/Word/Word-Library/NET/wordml.md new file mode 100644 index 000000000..bbf5082bc --- /dev/null +++ b/Document-Processing/Word/Word-Library/NET/wordml.md @@ -0,0 +1,107 @@ +--- +title: Convert Word to WordML file and vice versa in C# | Syncfusion +description: Learn how to convert Word document to WordML file and vice versa using the .NET Word (DocIO) library without Microsoft Word or interop dependencies. +platform: document-processing +control: DocIO +documentation: UG +--- + +# WordML Conversions in Word Library + +The Essential® DocIO converts the Word document into WordML file and vice versa. + +## Convert Word to WordML + +The following code example shows how to convert the Word document into WordML file. + +N> Refer to the appropriate tabs in the code snippets section: ***C# [Cross-platform]*** for ASP.NET Core, Blazor, Xamarin, UWP, .NET MAUI, and WinUI; ***C# [Windows-specific]*** for WinForms and WPF; ***VB.NET [Windows-specific]*** for VB.NET applications. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/WordML-conversion/Convert-Word-to-WordML/.NET/Convert-Word-to-WordML/Program.cs" %} +FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); +//Loads an existing Word document into DocIO instance +using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) +{ + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) + { + //Creates file stream + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.xml"), FileMode.Create, FileAccess.ReadWrite)) + { + //Save the loaded document in WordML format to the output stream + document.Save(outputFileStream, FormatType.WordML); + //Closes the Word document + document.Close(); + } + } +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +//Loads a template document +WordDocument document = new WordDocument("Template.docx"); +//Saves the document as WordML file +document.Save("WordToWordML.xml", FormatType.WordML); +//Closes the document +document.Close(); +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Loads a template document +Dim document As New WordDocument("Template.docx") +'Saves the document as WordML file +document.Save("WordToWordML.xml", FormatType.WordML) +'Closes the document +document.Close() +{% endhighlight %} + +{% endtabs %} + +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/WordML-conversion/Convert-Word-to-WordML/.NET). + +## Convert WordML to Word + +The following code example shows how to convert a WordML file into Word document. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" playgroundButtonLink="https://raw.githubusercontent.com/SyncfusionExamples/DocIO-Examples/refs/heads/main/WordML-conversion/Convert-WordML-to-Word/.NET/Convert-WordML-to-Word/Program.cs" %} +FileStream fileStreamPath = new FileStream("Template.txt", FileMode.Open, FileAccess.Read, FileShare.ReadWrite); +//Loads an existing WordML file into DocIO instance +using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.xml"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) +{ + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.WordML)) + { + //Creates file stream + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + { + //Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Docx); + //Closes the Word document + document.Close(); + } + } +} +{% endhighlight %} + +{% highlight c# tabtitle="C# [Windows-specific]" %} +//Loads a WordML file +WordDocument document = new WordDocument("Template.xml"); +//Saves the document as Word document +document.Save("WordMLToWord.docx", FormatType.Docx); +//Closes the document +document.Close(); +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Loads a WordML file +Dim document As New WordDocument("Template.xml") +'Saves the document as Word document +document.Save("WordMLToWord.docx", FormatType.Docx) +'Closes the document +document.Close() +{% endhighlight %} + +{% endtabs %} + +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/WordML-conversion/Convert-WordML-to-Word/.NET). From 98d7c1263385fa9b5a9338ef2ae271dc8dab66fc Mon Sep 17 00:00:00 2001 From: Kathiresan4347 <159137198+Kathiresan4347@users.noreply.github.com> Date: Tue, 3 Feb 2026 12:58:26 +0530 Subject: [PATCH 2/2] 1007016-Resolved CI issue --- .../Word/Word-Library/NET/Support-File-Formats.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md b/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md index a9e9284a1..5996dd8de 100644 --- a/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md +++ b/Document-Processing/Word/Word-Library/NET/Support-File-Formats.md @@ -25,7 +25,7 @@ DOC {{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/open-and-save-word-document-in-console-application#open-and-save-word-document-using-net-core-and-latest)'| markdownify }} -{{'[Word Processing XML (2007)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-open-xml-formats-2007--later)'| markdownify }} +{{'[Word Processing XML (2007)]()'| markdownify }} DOT