From 789a2a879a7ab8cce9d15cbb40a32970745d4da4 Mon Sep 17 00:00:00 2001 From: vderyushev Date: Thu, 1 Feb 2024 12:01:44 +0300 Subject: [PATCH] Fixed test --- Examples/ApiExamples/ApiExamples/ExDocumentBuilder.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Examples/ApiExamples/ApiExamples/ExDocumentBuilder.cs b/Examples/ApiExamples/ApiExamples/ExDocumentBuilder.cs index 4cc3847c7..d6331c345 100644 --- a/Examples/ApiExamples/ApiExamples/ExDocumentBuilder.cs +++ b/Examples/ApiExamples/ApiExamples/ExDocumentBuilder.cs @@ -1484,13 +1484,14 @@ public void InsertHyperlinkToLocalBookmark() // to the "InsertHyperlink" method as part of the argument containing the referenced bookmark's name. builder.Font.Color = Color.Blue; builder.Font.Underline = Underline.Single; - builder.InsertHyperlink("Link to Bookmark1", @"Bookmark1"" \o ""Hyperlink Tip", true); + FieldHyperlink hyperlink = (FieldHyperlink)builder.InsertHyperlink("Link to Bookmark1", "Bookmark1", true); + hyperlink.ScreenTip = "Hyperlink Tip"; doc.Save(ArtifactsDir + "DocumentBuilder.InsertHyperlinkToLocalBookmark.docx"); //ExEnd doc = new Document(ArtifactsDir + "DocumentBuilder.InsertHyperlinkToLocalBookmark.docx"); - FieldHyperlink hyperlink = (FieldHyperlink)doc.Range.Fields[0]; + hyperlink = (FieldHyperlink)doc.Range.Fields[0]; TestUtil.VerifyField(FieldType.FieldHyperlink, " HYPERLINK \\l \"Bookmark1\" \\o \"Hyperlink Tip\" ", "Link to Bookmark1", hyperlink); Assert.AreEqual("Bookmark1", hyperlink.SubAddress);