From 223d91834f79382afe551b6248a5bd40882c18f8 Mon Sep 17 00:00:00 2001 From: JianCheng Date: Fri, 8 Jun 2018 16:26:27 +0800 Subject: [PATCH] Fix ">>" remains in docx file after replaced The ">>" remains in docx file after replaced the mergefield. --- OpenXmlWordHelpers.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenXmlWordHelpers.cs b/OpenXmlWordHelpers.cs index 0196b2a..a37df90 100644 --- a/OpenXmlWordHelpers.cs +++ b/OpenXmlWordHelpers.cs @@ -103,11 +103,13 @@ public static void ReplaceWithText(this FieldCode field, string replacementText) Run rSep = rFldCode.NextSibling(); Run rText = rSep.NextSibling(); Run rEnd = rText.NextSibling(); + Run rRight = rEnd.NextSibling(); rFldCode.Remove(); rBegin.Remove(); rSep.Remove(); rEnd.Remove(); + rRight.Remove(); Text t = rText.GetFirstChild(); if (t != null)