From 6f07c979cde4da4480bcb487919fe1fc17c244b0 Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:29:44 +0530 Subject: [PATCH 1/9] Update Working-with-Charts.md with Remove Chart title details --- File-Formats/DocIO/Working-with-Charts.md | 78 ++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/File-Formats/DocIO/Working-with-Charts.md b/File-Formats/DocIO/Working-with-Charts.md index f5b08d62c..9ce5102ae 100644 --- a/File-Formats/DocIO/Working-with-Charts.md +++ b/File-Formats/DocIO/Working-with-Charts.md @@ -759,6 +759,82 @@ document.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Applying-3D-formats). +## Removing Chart Title + +The following code example illustrates how to remove the chart title from the document. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +//Creates a new instance of WordDocument (Empty Word Document). +using (WordDocument document = new WordDocument()) +{ + //Adds section to the document. + IWSection sec = document.AddSection(); + //Adds paragraph to the section. + IWParagraph paragraph = sec.AddParagraph(); + //Creates and Appends chart to the paragraph. + Chart chart = paragraph.AppendChart(446, 270); + //Sets chart type. + chart.ChartType = OfficeChartType.Pie; + //Sets chart title. + chart.ChartTitle = string.Empty; + //Sets data for chart. + chart.ChartData.SetValue(1, 1, ""); + chart.ChartData.SetValue(1, 2, "Sales"); + chart.ChartData.SetValue(2, 1, "Phyllis Lapin"); + chart.ChartData.SetValue(2, 2, 141.396); + chart.ChartData.SetValue(3, 1, "Stanley Hudson"); + chart.ChartData.SetValue(3, 2, 80.368); + //Creates a new chart series with the name “Sales”. + IOfficeChartSerie pieSeries = chart.Series.Add("Sales"); + pieSeries.Values = chart.ChartData[2, 2, 3, 2]; + //Sets category labels. + chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 3, 1]; + //Creates file stream. + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + { + //Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Docx); + } +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Adds section to the document. + Dim sec As IWSection = document.AddSection() +'Adds paragraph to the section. + Dim paragraph As IWParagraph = sec.AddParagraph() +'Creates and Appends chart to the paragraph. + Dim chart As Chart = paragraph.AppendChart(446,270) +'Sets chart type. + chart.ChartType = OfficeChartType.Pie +'Sets chart title. + chart.ChartTitle = String.Empty +'Sets data for chart. + chart.ChartData.SetValue(1, 1, "") + chart.ChartData.SetValue(1, 2, "Sales") + chart.ChartData.SetValue(2, 1, "Phyllis Lapin") + chart.ChartData.SetValue(2, 2, 141.396) + chart.ChartData.SetValue(3, 1, "Stanley Hudson") + chart.ChartData.SetValue(3, 2, 80.368) +'Creates a new chart series with the name “Sales”. + Dim pieSeries As IOfficeChartSerie = chart.Series.Add("Sales") + pieSeries.Values = chart.ChartData(2, 2, 3, 2) +'Sets category labels. + chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 3, 1) +'Creates file stream. + Imports (FileStream outputFileStream = New FileStream(Path.GetFullPath("../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + { + 'Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Docx) + } +{% endhighlight %} + +{% endtabs %} + +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Remove-chart-title/.NET%20Standard) + ## Removing Chart The following code example illustrates how to remove the chart from the document. @@ -1257,4 +1333,4 @@ The following chart types are supported in DocIO. * [How to create line chart with different color series in Word document using C#?](https://support.syncfusion.com/kb/article/12275/how-to-create-line-chart-with-different-color-series-in-word-document-using-c) * [How to set column space for column charts in Word document?](https://support.syncfusion.com/kb/article/12296/how-to-set-column-space-for-column-charts-in-word-document) * [How to set Y-axis interval for column charts in Word document?](https://support.syncfusion.com/kb/article/12294/how-to-set-y-axis-interval-for-column-charts-in-word-document) -* [How to change chart title position in the Word document?](https://support.syncfusion.com/kb/article/12292/how-to-change-chart-title-position-in-the-word-document) \ No newline at end of file +* [How to change chart title position in the Word document?](https://support.syncfusion.com/kb/article/12292/how-to-change-chart-title-position-in-the-word-document) From 3bb3f1b97e0be5a29dbaa61b39d089f39d7ecedb Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:44:06 +0530 Subject: [PATCH 2/9] Update Chart-Title.md --- File-Formats/DocIO/Charts/Chart-Title.md | 78 +++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index 5b5817933..27da831a1 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -196,4 +196,80 @@ End Using {% endhighlight %} {% endtabs %} -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Format-Chart-Title/.NET). \ No newline at end of file +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Format-Chart-Title/.NET). + +## Remove Chart Title + +The following code example illustrates how to remove the chart title from the document. + +{% tabs %} + +{% highlight c# tabtitle="C# [Cross-platform]" %} +//Creates a new instance of WordDocument (Empty Word Document). +using (WordDocument document = new WordDocument()) +{ + //Adds section to the document. + IWSection sec = document.AddSection(); + //Adds paragraph to the section. + IWParagraph paragraph = sec.AddParagraph(); + //Creates and Appends chart to the paragraph. + Chart chart = paragraph.AppendChart(446, 270); + //Sets chart type. + chart.ChartType = OfficeChartType.Pie; + //Sets chart title. + chart.ChartTitle = string.Empty; + //Sets data for chart. + chart.ChartData.SetValue(1, 1, ""); + chart.ChartData.SetValue(1, 2, "Sales"); + chart.ChartData.SetValue(2, 1, "Phyllis Lapin"); + chart.ChartData.SetValue(2, 2, 141.396); + chart.ChartData.SetValue(3, 1, "Stanley Hudson"); + chart.ChartData.SetValue(3, 2, 80.368); + //Creates a new chart series with the name “Sales”. + IOfficeChartSerie pieSeries = chart.Series.Add("Sales"); + pieSeries.Values = chart.ChartData[2, 2, 3, 2]; + //Sets category labels. + chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 3, 1]; + //Creates file stream. + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + { + //Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Docx); + } +} +{% endhighlight %} + +{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Adds section to the document. + Dim sec As IWSection = document.AddSection() +'Adds paragraph to the section. + Dim paragraph As IWParagraph = sec.AddParagraph() +'Creates and Appends chart to the paragraph. + Dim chart As Chart = paragraph.AppendChart(446,270) +'Sets chart type. + chart.ChartType = OfficeChartType.Pie +'Sets chart title. + chart.ChartTitle = String.Empty +'Sets data for chart. + chart.ChartData.SetValue(1, 1, "") + chart.ChartData.SetValue(1, 2, "Sales") + chart.ChartData.SetValue(2, 1, "Phyllis Lapin") + chart.ChartData.SetValue(2, 2, 141.396) + chart.ChartData.SetValue(3, 1, "Stanley Hudson") + chart.ChartData.SetValue(3, 2, 80.368) +'Creates a new chart series with the name “Sales”. + Dim pieSeries As IOfficeChartSerie = chart.Series.Add("Sales") + pieSeries.Values = chart.ChartData(2, 2, 3, 2) +'Sets category labels. + chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 3, 1) +'Creates file stream. + Imports (FileStream outputFileStream = New FileStream(Path.GetFullPath("../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + { + 'Saves the Word document to file stream. + document.Save(outputFileStream, FormatType.Docx) + } +{% endhighlight %} + +{% endtabs %} + +You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Remove-chart-title). From 2be32090ba37b6ac77143e48f4552b96b67baacf Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:46:01 +0530 Subject: [PATCH 3/9] Update Chart-Title.md --- File-Formats/DocIO/Charts/Chart-Title.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index 27da831a1..b63c68128 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -200,7 +200,7 @@ You can download a complete working sample from [GitHub](https://github.com/Sync ## Remove Chart Title -The following code example illustrates how to remove the chart title from the document. +The following code example illustrates how to remove the chart title from the Word document. {% tabs %} From 1dc1e78b5552ef60750d12810aeb4077930236c2 Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:51:51 +0530 Subject: [PATCH 4/9] Update Chart-Title.md --- File-Formats/DocIO/Charts/Chart-Title.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index b63c68128..bbbd80e2b 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -230,12 +230,11 @@ using (WordDocument document = new WordDocument()) pieSeries.Values = chart.ChartData[2, 2, 3, 2]; //Sets category labels. chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 3, 1]; - //Creates file stream. - using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) - { - //Saves the Word document to file stream. - document.Save(outputFileStream, FormatType.Docx); - } + //Saves the Word document to MemoryStream. + MemoryStream stream = new MemoryStream(); + document.Save(stream, FormatType.Docx); + //Closes the document. + document.Close(); } {% endhighlight %} @@ -263,10 +262,10 @@ using (WordDocument document = new WordDocument()) 'Sets category labels. chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 3, 1) 'Creates file stream. - Imports (FileStream outputFileStream = New FileStream(Path.GetFullPath("../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) + Imports (MemoryStream stream = New MemoryStream()) { - 'Saves the Word document to file stream. - document.Save(outputFileStream, FormatType.Docx) + 'Saves the Word document to memory stream. + document.Save(stream, FormatType.Docx) } {% endhighlight %} From 0449b45141bda8c2a9e22175a31000f6b9e61dcf Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:54:01 +0530 Subject: [PATCH 5/9] Update Working-with-Charts.md --- File-Formats/DocIO/Working-with-Charts.md | 76 ----------------------- 1 file changed, 76 deletions(-) diff --git a/File-Formats/DocIO/Working-with-Charts.md b/File-Formats/DocIO/Working-with-Charts.md index 9ce5102ae..082b28bcd 100644 --- a/File-Formats/DocIO/Working-with-Charts.md +++ b/File-Formats/DocIO/Working-with-Charts.md @@ -759,82 +759,6 @@ document.Close() You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Applying-3D-formats). -## Removing Chart Title - -The following code example illustrates how to remove the chart title from the document. - -{% tabs %} - -{% highlight c# tabtitle="C# [Cross-platform]" %} -//Creates a new instance of WordDocument (Empty Word Document). -using (WordDocument document = new WordDocument()) -{ - //Adds section to the document. - IWSection sec = document.AddSection(); - //Adds paragraph to the section. - IWParagraph paragraph = sec.AddParagraph(); - //Creates and Appends chart to the paragraph. - Chart chart = paragraph.AppendChart(446, 270); - //Sets chart type. - chart.ChartType = OfficeChartType.Pie; - //Sets chart title. - chart.ChartTitle = string.Empty; - //Sets data for chart. - chart.ChartData.SetValue(1, 1, ""); - chart.ChartData.SetValue(1, 2, "Sales"); - chart.ChartData.SetValue(2, 1, "Phyllis Lapin"); - chart.ChartData.SetValue(2, 2, 141.396); - chart.ChartData.SetValue(3, 1, "Stanley Hudson"); - chart.ChartData.SetValue(3, 2, 80.368); - //Creates a new chart series with the name “Sales”. - IOfficeChartSerie pieSeries = chart.Series.Add("Sales"); - pieSeries.Values = chart.ChartData[2, 2, 3, 2]; - //Sets category labels. - chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 3, 1]; - //Creates file stream. - using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) - { - //Saves the Word document to file stream. - document.Save(outputFileStream, FormatType.Docx); - } -} -{% endhighlight %} - -{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} -'Adds section to the document. - Dim sec As IWSection = document.AddSection() -'Adds paragraph to the section. - Dim paragraph As IWParagraph = sec.AddParagraph() -'Creates and Appends chart to the paragraph. - Dim chart As Chart = paragraph.AppendChart(446,270) -'Sets chart type. - chart.ChartType = OfficeChartType.Pie -'Sets chart title. - chart.ChartTitle = String.Empty -'Sets data for chart. - chart.ChartData.SetValue(1, 1, "") - chart.ChartData.SetValue(1, 2, "Sales") - chart.ChartData.SetValue(2, 1, "Phyllis Lapin") - chart.ChartData.SetValue(2, 2, 141.396) - chart.ChartData.SetValue(3, 1, "Stanley Hudson") - chart.ChartData.SetValue(3, 2, 80.368) -'Creates a new chart series with the name “Sales”. - Dim pieSeries As IOfficeChartSerie = chart.Series.Add("Sales") - pieSeries.Values = chart.ChartData(2, 2, 3, 2) -'Sets category labels. - chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 3, 1) -'Creates file stream. - Imports (FileStream outputFileStream = New FileStream(Path.GetFullPath("../../../Result.docx"), FileMode.Create, FileAccess.ReadWrite)) - { - 'Saves the Word document to file stream. - document.Save(outputFileStream, FormatType.Docx) - } -{% endhighlight %} - -{% endtabs %} - -You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/DocIO-Examples/tree/main/Charts/Remove-chart-title/.NET%20Standard) - ## Removing Chart The following code example illustrates how to remove the chart from the document. From e830f468bf49793fc49bd303ea2bf8a7dc673c09 Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 24 Jan 2024 19:01:19 +0530 Subject: [PATCH 6/9] Update Chart-Title.md --- File-Formats/DocIO/Charts/Chart-Title.md | 34 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index bbbd80e2b..00d8d7254 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -213,7 +213,7 @@ using (WordDocument document = new WordDocument()) //Adds paragraph to the section. IWParagraph paragraph = sec.AddParagraph(); //Creates and Appends chart to the paragraph. - Chart chart = paragraph.AppendChart(446, 270); + WChart chart = paragraph.AppendChart(446, 270); //Sets chart type. chart.ChartType = OfficeChartType.Pie; //Sets chart title. @@ -238,13 +238,43 @@ using (WordDocument document = new WordDocument()) } {% endhighlight %} +{% highlight c# tabtitle="C# [Windows-specific]" %} +using (WordDocument document = new WordDocument("Template.docx", FormatType.Docx)) +{ + //Adds section to the document. + IWSection sec = document.AddSection(); + //Adds paragraph to the section. + IWParagraph paragraph = sec.AddParagraph(); + //Creates and Appends chart to the paragraph. + WChart chart = paragraph.AppendChart(446, 270); + //Sets chart type. + chart.ChartType = OfficeChartType.Pie; + //Sets chart title. + chart.ChartTitle = string.Empty; + //Sets data for chart. + chart.ChartData.SetValue(1, 1, ""); + chart.ChartData.SetValue(1, 2, "Sales"); + chart.ChartData.SetValue(2, 1, "Phyllis Lapin"); + chart.ChartData.SetValue(2, 2, 141.396); + chart.ChartData.SetValue(3, 1, "Stanley Hudson"); + chart.ChartData.SetValue(3, 2, 80.368); + //Creates a new chart series with the name “Sales”. + IOfficeChartSerie pieSeries = chart.Series.Add("Sales"); + pieSeries.Values = chart.ChartData[2, 2, 3, 2]; + //Sets category labels. + chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 3, 1]; + //Saves the document + document.Save("Sample.docx"); +} +{% endhighlight %} + {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} 'Adds section to the document. Dim sec As IWSection = document.AddSection() 'Adds paragraph to the section. Dim paragraph As IWParagraph = sec.AddParagraph() 'Creates and Appends chart to the paragraph. - Dim chart As Chart = paragraph.AppendChart(446,270) + Dim chart As WChart = paragraph.AppendChart(446,270) 'Sets chart type. chart.ChartType = OfficeChartType.Pie 'Sets chart title. From d6eb3a03dee3defa18ad3c0de3a55c07f843545c Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:25:37 +0530 Subject: [PATCH 7/9] Update Chart-Title.md --- File-Formats/DocIO/Charts/Chart-Title.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index 00d8d7254..834b101b8 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -205,7 +205,7 @@ The following code example illustrates how to remove the chart title from the Wo {% tabs %} {% highlight c# tabtitle="C# [Cross-platform]" %} -//Creates a new instance of WordDocument (Empty Word Document). +//Creates a new instance of WordDocument. using (WordDocument document = new WordDocument()) { //Adds section to the document. From 8d782b10ea81b7584f2f2f8a3d13660f294d1352 Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:29:23 +0530 Subject: [PATCH 8/9] Update Chart-Title.md --- File-Formats/DocIO/Charts/Chart-Title.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index 834b101b8..38a9eb467 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -239,7 +239,7 @@ using (WordDocument document = new WordDocument()) {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} -using (WordDocument document = new WordDocument("Template.docx", FormatType.Docx)) +using (WordDocument document = new WordDocument()) { //Adds section to the document. IWSection sec = document.AddSection(); From 16916ecd855bebda8575cac1e9cb9d8fe8ac539d Mon Sep 17 00:00:00 2001 From: AkashArul26 <95226047+AkashArul26@users.noreply.github.com> Date: Wed, 14 Feb 2024 17:38:54 +0530 Subject: [PATCH 9/9] Committing the concerned changes in Update Chart-Title.md Committing the concerned changes --- File-Formats/DocIO/Charts/Chart-Title.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/File-Formats/DocIO/Charts/Chart-Title.md b/File-Formats/DocIO/Charts/Chart-Title.md index 38a9eb467..6a47a805d 100644 --- a/File-Formats/DocIO/Charts/Chart-Title.md +++ b/File-Formats/DocIO/Charts/Chart-Title.md @@ -239,6 +239,7 @@ using (WordDocument document = new WordDocument()) {% endhighlight %} {% highlight c# tabtitle="C# [Windows-specific]" %} +//Creates a new instance of WordDocument. using (WordDocument document = new WordDocument()) { //Adds section to the document. @@ -265,10 +266,14 @@ using (WordDocument document = new WordDocument()) chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[2, 1, 3, 1]; //Saves the document document.Save("Sample.docx"); + //Closes the document. + document.Close(); } {% endhighlight %} {% highlight vb.net tabtitle="VB.NET [Windows-specific]" %} +'Creates an empty WordDocument instance + Dim document As New WordDocument() 'Adds section to the document. Dim sec As IWSection = document.AddSection() 'Adds paragraph to the section. @@ -291,12 +296,10 @@ using (WordDocument document = new WordDocument()) pieSeries.Values = chart.ChartData(2, 2, 3, 2) 'Sets category labels. chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData(2, 1, 3, 1) -'Creates file stream. - Imports (MemoryStream stream = New MemoryStream()) - { - 'Saves the Word document to memory stream. - document.Save(stream, FormatType.Docx) - } +'Saves the document + document.Save("Sample.docx", FormatType.Docx) +'Closes the document + document.Close() {% endhighlight %} {% endtabs %}