Skip to content

Commit f43e10e

Browse files
committed
Modified the variable name
1 parent 34b427f commit f43e10e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Mail-Merge/Insert-hyperlink-during-Mailmerge/.NET/Insert-hyperlink-during-Mailmerge/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ private static void InsertHyperlink(WordDocument document)
7171
WTextRange mergeFieldText = paragraph.ChildEntities[index] as WTextRange;
7272
if (mergeFieldText != null)
7373
{
74+
string hyperlinkText = mergeFieldText.Text;
7475
WParagraph hyperlinkParagraph = new WParagraph(document);
75-
WField hyperlink = hyperlinkParagraph.AppendHyperlink(mergeFieldText.Text.ToString(), mergeFieldText.Text.ToString(), HyperlinkType.WebLink) as WField;
76+
WField hyperlink = hyperlinkParagraph.AppendHyperlink(hyperlinkText, hyperlinkText, HyperlinkType.WebLink) as WField;
7677
// Insert the child entity (e.g., hyperlink) from the new paragraph into the original paragraph
7778
for (int j = hyperlinkParagraph.ChildEntities.Count - 1; j >= 0; j--)
7879
{

0 commit comments

Comments
 (0)