diff --git a/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page.sln b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page.sln new file mode 100644 index 00000000..1f58fc82 --- /dev/null +++ b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37614.0 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Make-Paragraph-To-Start-On-New-Page", "Make-Paragraph-To-Start-On-New-Page\Make-Paragraph-To-Start-On-New-Page.csproj", "{08579255-C4D0-D3D2-F29B-F447F32D50D9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {08579255-C4D0-D3D2-F29B-F447F32D50D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08579255-C4D0-D3D2-F29B-F447F32D50D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08579255-C4D0-D3D2-F29B-F447F32D50D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08579255-C4D0-D3D2-F29B-F447F32D50D9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AC6C429F-37FB-4F82-AAFF-4EB906F0F299} + EndGlobalSection +EndGlobal diff --git a/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Make-Paragraph-To-Start-On-New-Page.csproj b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Make-Paragraph-To-Start-On-New-Page.csproj new file mode 100644 index 00000000..676b135f --- /dev/null +++ b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Make-Paragraph-To-Start-On-New-Page.csproj @@ -0,0 +1,21 @@ + + + + Exe + net8.0 + Make_Paragraph_To_Start_On_New_Page + + + + + Always + + + + + + + + + + diff --git a/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Output/.gitkeep b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Output/Output.docx b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Output/Output.docx new file mode 100644 index 00000000..566b7289 Binary files /dev/null and b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Output/Output.docx differ diff --git a/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Program.cs b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Program.cs new file mode 100644 index 00000000..3bfa8c27 --- /dev/null +++ b/Paragraphs/Make-Paragraph-To-Start-On-New-Page/.NET/Make-Paragraph-To-Start-On-New-Page/Program.cs @@ -0,0 +1,35 @@ +using Syncfusion.DocIO.DLS; +using System.IO; + +namespace Make_Paragraph_To_Start_On_New_Page +{ + class Program + { + static void Main(string[] args) + { + //Creates a new Word document instance. + using (WordDocument document = new WordDocument()) + { + //Adds the section into Word document. + IWSection section = document.AddSection(); + + //Adds a paragraph to created section. + IWParagraph firstPageParagraph = section.AddParagraph(); + + //Appends the text to the created paragraph. + IWTextRange textRange = firstPageParagraph.AppendText("Adventure Works Cycles, the fictitious company on which the AdventureWorks sample databases are based, is a large, multinational manufacturing company."); + + //Adds a paragraph move to the new page + IWParagraph paragraph = section.AddParagraph(); + + //Sets Page break. + paragraph.ParagraphFormat.PageBreakBefore = true; + + //Appends the text to the created paragraph. + IWTextRange newPageTextRange = paragraph.AppendText("The company manufactures and sells metal and composite bicycles to North American, European and Asian commercial markets."); + + document.Save(Path.GetFullPath("Output/Output.docx")); + } + } + } +}