Skip to content

Commit f746b82

Browse files
Merge pull request #2200 from syncfusion-content/1007016_Updated_supported_file_format_page_docio
1007016- Updated Supported File Format UG page
2 parents 016ea40 + 91d82b5 commit f746b82

3 files changed

Lines changed: 125 additions & 15 deletions

File tree

Document-Processing/Word/Word-Library/NET/Support-File-Formats.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ The following table describes the supported file formats and their conversions i
1919
</tr>
2020
<tr>
2121
<th>
22-
{{'[DOC](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-binary-97-2003-format)'| markdownify }}
22+
DOC
2323
</th>
2424
<th>
25-
{{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#doc-to-docx-and-docx-to-doc)'| markdownify }}
25+
{{'[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 }}
2626
</th>
2727
<th>
28-
{{'[Word Processing XML (2007)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-open-xml-formats-2007--later)'| markdownify }}
28+
{{'[Word Processing XML (2007)]()'| markdownify }}
2929
</th>
3030
<th>
31-
{{'[DOT](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }}
31+
DOT
3232
</th>
3333
<th>
34-
{{'[DOTX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }}
34+
DOTX
3535
</th>
3636
<th>
37-
{{'[DOCM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }}
37+
DOCM
3838
</th>
3939
<th>
40-
{{'[DOTM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }}
40+
DOTM
4141
</th>
4242
<th>
4343
{{'[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
6262
</th>
6363
</tr>
6464
<tr>
65-
<th>{{'[DOC](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-binary-97-2003-format)'| markdownify }}</th>
65+
<th>DOC</th>
6666
<td>Yes</td>
6767
<td>Yes</td>
6868
<td>Yes</td>
@@ -79,7 +79,7 @@ The following table describes the supported file formats and their conversions i
7979
<td>Yes</td>
8080
</tr>
8181
<tr>
82-
<th>{{'[DOCX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#doc-to-docx-and-docx-to-doc)'| markdownify }}</th>
82+
<th>{{'[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 }}</th>
8383
<td>Yes</td>
8484
<td>Yes</td>
8585
<td>Yes</td>
@@ -96,7 +96,7 @@ The following table describes the supported file formats and their conversions i
9696
<td>Yes</td>
9797
</tr>
9898
<tr>
99-
<th>{{'[Word Processing XML (2003)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-processing-xml-xml)'| markdownify }}</th>
99+
<th>Word Processing XML (2003)</th>
100100
<td>Yes</td>
101101
<td>Yes</td>
102102
<td>Yes</td>
@@ -113,7 +113,7 @@ The following table describes the supported file formats and their conversions i
113113
<td>Yes</td>
114114
</tr>
115115
<tr>
116-
<th>{{'[Word Processing XML (2007)](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#word-open-xml-formats-2007--later)'| markdownify }}</th>
116+
<th>{{'[Word Processing XML (2007)]()'| markdownify }}</th>
117117
<td>Yes</td>
118118
<td>Yes</td>
119119
<td>Yes</td>
@@ -130,7 +130,7 @@ The following table describes the supported file formats and their conversions i
130130
<td>Yes</td>
131131
</tr>
132132
<tr>
133-
<th>{{'[DOT](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }}</th>
133+
<th>DOT</th>
134134
<td>Yes</td>
135135
<td>Yes</td>
136136
<td>Yes</td>
@@ -147,7 +147,7 @@ The following table describes the supported file formats and their conversions i
147147
<td>Yes</td>
148148
</tr>
149149
<tr>
150-
<th>{{'[DOTX](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#templates)'| markdownify }}</th>
150+
<th>DOTX</th>
151151
<td>Yes</td>
152152
<td>Yes</td>
153153
<td>Yes</td>
@@ -164,7 +164,7 @@ The following table describes the supported file formats and their conversions i
164164
<td>Yes</td>
165165
</tr>
166166
<tr>
167-
<th>{{'[DOCM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }}</th>
167+
<th>DOCM</th>
168168
<td>Yes</td>
169169
<td>Yes</td>
170170
<td>Yes</td>
@@ -181,7 +181,7 @@ The following table describes the supported file formats and their conversions i
181181
<td>Yes</td>
182182
</tr>
183183
<tr>
184-
<th>{{'[DOTM](https://help.syncfusion.com/document-processing/word/word-library/net/word-file-formats#macros)'| markdownify }}</th>
184+
<th>DOTM</th>
185185
<td>Yes</td>
186186
<td>Yes</td>
187187
<td>Yes</td>

Document-Processing/Word/Word-Library/NET/rtf.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ The [Rich Text Format (RTF)](https://en.wikipedia.org/wiki/Rich_Text_Format) is
1313

1414
Most of the Word processors (including Microsoft Word) uses the XML-based file formats, Microsoft has discontinued enhancements to the RTF and still supporting it. The last version was 1.9.1 released in 2008.
1515

16+
To quickly start converting a Word document to RTF and vice versa, please check out this video:
17+
{% youtube "https://www.youtube.com/watch?v=U5JRWJ42U3s" %}
18+
1619
## Assemblies and NuGet packages required
1720

1821
Refer to the following links for assemblies and NuGet packages required based on platforms to convert the RTF document into Word document and vice versa using the .NET Word Library (DocIO).
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: Convert Word to WordML file and vice versa in C# | Syncfusion
3+
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.
4+
platform: document-processing
5+
control: DocIO
6+
documentation: UG
7+
---
8+
9+
# WordML Conversions in Word Library
10+
11+
The Essential<sup>&reg;</sup> DocIO converts the Word document into WordML file and vice versa.
12+
13+
## Convert Word to WordML
14+
15+
The following code example shows how to convert the Word document into WordML file.
16+
17+
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.
18+
19+
{% tabs %}
20+
21+
{% 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" %}
22+
FileStream fileStreamPath = new FileStream("Template.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
23+
//Loads an existing Word document into DocIO instance
24+
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.docx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
25+
{
26+
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx))
27+
{
28+
//Creates file stream
29+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.xml"), FileMode.Create, FileAccess.ReadWrite))
30+
{
31+
//Save the loaded document in WordML format to the output stream
32+
document.Save(outputFileStream, FormatType.WordML);
33+
//Closes the Word document
34+
document.Close();
35+
}
36+
}
37+
}
38+
{% endhighlight %}
39+
40+
{% highlight c# tabtitle="C# [Windows-specific]" %}
41+
//Loads a template document
42+
WordDocument document = new WordDocument("Template.docx");
43+
//Saves the document as WordML file
44+
document.Save("WordToWordML.xml", FormatType.WordML);
45+
//Closes the document
46+
document.Close();
47+
{% endhighlight %}
48+
49+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
50+
'Loads a template document
51+
Dim document As New WordDocument("Template.docx")
52+
'Saves the document as WordML file
53+
document.Save("WordToWordML.xml", FormatType.WordML)
54+
'Closes the document
55+
document.Close()
56+
{% endhighlight %}
57+
58+
{% endtabs %}
59+
60+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/WordML-conversion/Convert-Word-to-WordML/.NET).
61+
62+
## Convert WordML to Word
63+
64+
The following code example shows how to convert a WordML file into Word document.
65+
66+
{% tabs %}
67+
68+
{% 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" %}
69+
FileStream fileStreamPath = new FileStream("Template.txt", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
70+
//Loads an existing WordML file into DocIO instance
71+
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Template.xml"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
72+
{
73+
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.WordML))
74+
{
75+
//Creates file stream
76+
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite))
77+
{
78+
//Saves the Word document to file stream.
79+
document.Save(outputFileStream, FormatType.Docx);
80+
//Closes the Word document
81+
document.Close();
82+
}
83+
}
84+
}
85+
{% endhighlight %}
86+
87+
{% highlight c# tabtitle="C# [Windows-specific]" %}
88+
//Loads a WordML file
89+
WordDocument document = new WordDocument("Template.xml");
90+
//Saves the document as Word document
91+
document.Save("WordMLToWord.docx", FormatType.Docx);
92+
//Closes the document
93+
document.Close();
94+
{% endhighlight %}
95+
96+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
97+
'Loads a WordML file
98+
Dim document As New WordDocument("Template.xml")
99+
'Saves the document as Word document
100+
document.Save("WordMLToWord.docx", FormatType.Docx)
101+
'Closes the document
102+
document.Close()
103+
{% endhighlight %}
104+
105+
{% endtabs %}
106+
107+
You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/WordML-conversion/Convert-WordML-to-Word/.NET).

0 commit comments

Comments
 (0)