Insert a Hyperlink

Contents
[ ]

The following code example shows how to inserts a hyperlink into a Word document using the DocumentBuilder class:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Please make sure to visit ");

// Specify font formatting for the hyperlink.
builder.Font.Color = Color.Blue;
builder.Font.Underline = Underline.Single;

// Insert the link.
builder.InsertHyperlink("Aspose Website", "https://www.aspose.com", false);

// Revert to default formatting.
builder.Font.ClearFormatting();
builder.Write(" for more information.");
doc.Save("Insert_Hyperlink_In_Document.doc");

See also: