Skip to content

Commit 6cb6ba9

Browse files
committed
Added changes
1 parent 0432859 commit 6cb6ba9

6 files changed

Lines changed: 69 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31911.196
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Merge-source-first-section-to-destination-last-section", "Merge-source-first-section-to-destination-last-section\Merge-source-first-section-to-destination-last-section.csproj", "{C17B90BC-F559-456B-B189-90B53FF6CDD4}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{C17B90BC-F559-456B-B189-90B53FF6CDD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C17B90BC-F559-456B-B189-90B53FF6CDD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C17B90BC-F559-456B-B189-90B53FF6CDD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C17B90BC-F559-456B-B189-90B53FF6CDD4}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {EF357FC6-E9E5-4E3C-B932-43F727BE1DE4}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Merge_source_first_section_to_destination_last_section</RootNamespace>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<None Update="Data\DestinationDocument.docx">
15+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
16+
</None>
17+
<None Update="Data\SourceDocument.docx">
18+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
19+
</None>
20+
<None Update="Output\.gitkeep">
21+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
22+
</None>
23+
</ItemGroup>
24+
25+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Syncfusion.DocIO;
2+
using Syncfusion.DocIO.DLS;
3+
4+
//Open the source document
5+
using (WordDocument sourceDocument = new WordDocument(@"../../../Data/SourceDocument.docx"))
6+
{
7+
8+
//Open the destination document
9+
using (WordDocument destinationDocument = new WordDocument(@"../../../Data/DestinationDocument.docx"))
10+
{
11+
12+
//Import the contents; the first source section is merged into the last destination section
13+
destinationDocument.ImportContent(sourceDocument, ImportOptions.UseDestinationStyles, true);
14+
15+
//Save the destination document
16+
destinationDocument.Save("../../../Output/CombinedDocument.docx", FormatType.Docx);
17+
}
18+
}

0 commit comments

Comments
 (0)