Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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}") = "Display-Multiple-Paragraph-Based-On-Merge-Field-Value", "Display-Multiple-Paragraph-Based-On-Merge-Field-Value\Display-Multiple-Paragraph-Based-On-Merge-Field-Value.csproj", "{781D1C7A-3B22-430C-D7D7-61F5D51117BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{781D1C7A-3B22-430C-D7D7-61F5D51117BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{781D1C7A-3B22-430C-D7D7-61F5D51117BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{781D1C7A-3B22-430C-D7D7-61F5D51117BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{781D1C7A-3B22-430C-D7D7-61F5D51117BA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8775710B-560C-4845-8EB2-77B493F52239}
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Display_Multiple_Paragraph_Based_On_Merge_Field_Value</RootNamespace>
</PropertyGroup>

<ItemGroup>
<None Update="Data\Template.docx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Output\.gitkeep">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
</ItemGroup>



</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Syncfusion.DocIO;
using Syncfusion.DocIO.DLS;
using System.IO;

namespace Display_Multiple_Paragraph_Based_On_Merge_Field_Value
{
class Program
{
static void Main(string[] args)
{
// Open the Word template document.
using (WordDocument document = new WordDocument(Path.GetFullPath(@"Data/Template.docx")))
{
// Define merge field names available in the template.
string[] fieldNames = new string[] { "VariableField1", "VariableField2" };

// Define values to be merged into the corresponding fields.
string[] fieldValues = new string[] { "1", "2" };

// Perform mail merge using the specified field names and values.
document.MailMerge.Execute(fieldNames, fieldValues);

// Update all document fields after mail merge.
document.UpdateDocumentFields();

// Save the generated document as a DOCX file.
document.Save(Path.GetFullPath(@"Output/Output.docx"), FormatType.Docx);
}
}
}
}
Loading