Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created May 4, 2022 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/94919efffebfe5efdd90d9a960c5a1eb to your computer and use it in GitHub Desktop.
Save bjoerntx/94919efffebfe5efdd90d9a960c5a1eb to your computer and use it in GitHub Desktop.
string jsonData = System.IO.File.ReadAllText("data.json");
using (MailMerge mm = new MailMerge() { TextComponent = textControl1 }) {
mm.FieldMerged += Mm_FieldMerged;
mm.RemoveEmptyFields = true;
mm.RemoveEmptyLines = true;
mm.MergeJsonData(jsonData);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment