Click here to Skip to main content
15,878,970 members
Articles / Desktop Programming / WPF

Fill Mergefields in .docx Documents without Microsoft Word

Rate me:
Please Sign up or sign in to vote.
4.92/5 (43 votes)
31 May 2011CPOL8 min read 423.3K   11K   128  
Utility class for filling mergefields (loose fields and tabular data) in a Microsoft Word (docx) template document, without needing Microsoft Word itself

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DocumentFillTester", "DocumentFillTester\DocumentFillTester.csproj", "{09376AE6-35F2-4ECD-8BED-0A1A6BB21D91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormFillLib", "FormFillLib\FormFillLib.csproj", "{32366E6B-0C96-478D-BDD1-9198590AE4AF}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{09376AE6-35F2-4ECD-8BED-0A1A6BB21D91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{09376AE6-35F2-4ECD-8BED-0A1A6BB21D91}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{09376AE6-35F2-4ECD-8BED-0A1A6BB21D91}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{09376AE6-35F2-4ECD-8BED-0A1A6BB21D91}.Release|Any CPU.Build.0 = Release|Any CPU
		{32366E6B-0C96-478D-BDD1-9198590AE4AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{32366E6B-0C96-478D-BDD1-9198590AE4AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{32366E6B-0C96-478D-BDD1-9198590AE4AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{32366E6B-0C96-478D-BDD1-9198590AE4AF}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO TRI-S bvba, Cogenius bvba
Belgium Belgium
I'm working since 1999 in an IT environment: started developing in PROGRESS 4GL, then VB6 and am working since 2003 with C#. I'm currently transitioning to HTML5, CSS3 and JavaScript for the front-end development.
I started my own company (TRI-S) in 2007 and co-founded another one (Cogenius) in 2012.
Besides being a Microsoft Certified Professional Developer (MCPD) I'm also a Microsoft Certified Trainer (MCT) and am teaching .NET and JavaScript courses.

Comments and Discussions