Skip to content

Commit 7c0dc5e

Browse files
authored
Update mail-merge.md
1 parent db626c2 commit 7c0dc5e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

libraries/radwordsprocessing/editing/mail-merge.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ Additionally, a field can be added to a Paragraph manually by creating a __Field
3838

3939
{{region cs-radwordsprocessing-editing-mail-merge_1}}
4040

41-
FieldInfo field = new FieldInfo(document);
41+
Paragraph paragraph = new Paragraph(document);
42+
document.Sections.First().Blocks.Add(paragraph);
43+
44+
FieldInfo field = new FieldInfo(document);
4245

4346
paragraph.Inlines.Add(field.Start);
4447
paragraph.Inlines.AddRun("MERGEFIELD LastName");
@@ -73,10 +76,16 @@ Example 3 shows a simple example data source.
7376
},
7477
new MailMergeRecord()
7578
{
76-
FirstName = "Nancy",
79+
FirstName = "Nancy",
7780
LastName = "Davolio"
7881
},
7982
};
83+
84+
public class MailMergeRecord
85+
{
86+
public string FirstName { get; set; }
87+
public string LastName { get; set; }
88+
}
8089
{{endregion}}
8190

8291

0 commit comments

Comments
 (0)