diff --git a/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word.slnx b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word.slnx new file mode 100644 index 000000000..628357901 --- /dev/null +++ b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word.slnx @@ -0,0 +1,3 @@ + + + diff --git a/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Convert-HTML-to-Word.csproj b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Convert-HTML-to-Word.csproj new file mode 100644 index 000000000..0b3b1ec96 --- /dev/null +++ b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Convert-HTML-to-Word.csproj @@ -0,0 +1,24 @@ + + + + Exe + net8.0 + Convert_HTML_to_Word + enable + enable + + + + + + + + + Always + + + Always + + + + diff --git a/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Data/Input.html b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Data/Input.html new file mode 100644 index 000000000..43aacdbc6 --- /dev/null +++ b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Data/Input.html @@ -0,0 +1,58 @@ + + +All CSS Selectors Demo + + + +

This is Element selector Paragraph

+

This is Class selector Paragraph

+

This is ID Selector Paragraph

+

This is Group Selector Paragraph

+

This is Group Selector Paragraph

+

This is Compound Selector Paragraph

+
+

This is Descendent Selector Paragraph +

+ + + + diff --git a/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Output/.gitkeep b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Output/.gitkeep new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Program.cs b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Program.cs new file mode 100644 index 000000000..45a1d7e07 --- /dev/null +++ b/HTML-conversions/Convert-HTML-with-CSS-Selctor-to-Word/.NET/Convert-HTML-to-Word/Program.cs @@ -0,0 +1,25 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; + +namespace Convert_HTML_to_Word +{ + class Program + { + static void Main(string[] args) + { + //Loads an existing Word document into DocIO instance. + using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(@"Data/Input.html"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + { + using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Html)) + { + //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); + } + } + } + } + } +}