diff --git a/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph.sln b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph.sln new file mode 100644 index 00000000..77540247 --- /dev/null +++ b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.37531.7 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Insert-Line-Break-In-Existing-Paragraph", "Insert-Line-Break-In-Existing-Paragraph\Insert-Line-Break-In-Existing-Paragraph.csproj", "{0116B7C5-2E51-E21E-97AA-DBDE995706F2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0116B7C5-2E51-E21E-97AA-DBDE995706F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0116B7C5-2E51-E21E-97AA-DBDE995706F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0116B7C5-2E51-E21E-97AA-DBDE995706F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0116B7C5-2E51-E21E-97AA-DBDE995706F2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8824FFA7-7EED-4DA3-B365-86A0A7CB83C2} + EndGlobalSection +EndGlobal diff --git a/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Data/Template.docx b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Data/Template.docx new file mode 100644 index 00000000..e80e7ced Binary files /dev/null and b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Data/Template.docx differ diff --git a/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Insert-Line-Break-In-Existing-Paragraph.csproj b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Insert-Line-Break-In-Existing-Paragraph.csproj new file mode 100644 index 00000000..1d471513 --- /dev/null +++ b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Insert-Line-Break-In-Existing-Paragraph.csproj @@ -0,0 +1,22 @@ + + + + Exe + net8.0 + Insert_Line_Break_In_Existing_Paragraph + + + + + + + + + Always + + + Always + + + + diff --git a/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Output/.gitkeep b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Output/.gitkeep new file mode 100644 index 00000000..5f282702 --- /dev/null +++ b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Output/.gitkeep @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Output/Output.docx b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Output/Output.docx new file mode 100644 index 00000000..75c511ea Binary files /dev/null and b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Output/Output.docx differ diff --git a/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Program.cs b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Program.cs new file mode 100644 index 00000000..d5952131 --- /dev/null +++ b/Paragraphs/Insert-Line-Break-In-Existing-Paragraph/.NET/Insert-Line-Break-In-Existing-Paragraph/Program.cs @@ -0,0 +1,17 @@ +using Syncfusion.DocIO.DLS; +using System.IO; + +//Loads the template document. +using (WordDocument document = new WordDocument(Path.GetFullPath("Data/Template.docx"))) +{ + //Gets the text body of first section. + WTextBody textBody = document.Sections[0].Body; + //Gets the paragraph at index 1. + WParagraph paragraph = textBody.Paragraphs[1]; + //Creates a new instance of the line break. + Break lineBreak = new Break(document, BreakType.LineBreak); + //Inserts line break to the paragraph at a specific location (index). + paragraph.ChildEntities.Insert(3, lineBreak); + document.Save(Path.GetFullPath(@"Output/Output.docx")); +} +