Skip to content

Commit 36abcf7

Browse files
Find-and-replace-merge-field-name
1 parent ecff2b0 commit 36abcf7

File tree

2 files changed

+2
-2
lines changed
  • Find-and-Replace/Find-and-replace-merge-field-name/.NET/Find-and-replace-merge-field-name

2 files changed

+2
-2
lines changed

Find-and-Replace/Find-and-replace-merge-field-name/.NET/Find-and-replace-merge-field-name/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ static void Main(string[] args)
1717
// Finds all merge fields in the document.
1818
List<Entity> mergeFields = document.FindAllItemsByProperty(EntityType.MergeField, null, null);
1919
// Replaces the merge field name "first_name" with "FirstName".
20-
ReplaceMergeFieldName("first_name", "FirstName", mergeFields);
20+
ReplaceMergeFieldName("Forename", "FirstName", mergeFields);
2121
// Replaces the merge field name "last_name" with "LastName".
22-
ReplaceMergeFieldName("last_name", "LastName", mergeFields);
22+
ReplaceMergeFieldName("Surname", "LastName", mergeFields);
2323
// Creates a file stream to save the modified document.
2424
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Result.docx"), FileMode.Create, FileAccess.ReadWrite))
2525
{

0 commit comments

Comments
 (0)