ShapeBaseHRef Property
Gets or sets the full hyperlink address for a shape.

Namespace: Aspose.Words.Drawing
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public string HRef { get; set; }

Property Value

Type: String

The default value is an empty string.

Below are examples of valid values for this property:

Full URI:

Full file name: C:\\My Documents\\SalesReport.doc.

Relative URI: ../../../resource.txt

Relative file name: ..\\My Documents\\SalesReport.doc.

Bookmark within another document:

Bookmark within this document: #BookmakName.

Shows how to insert an image with a hyperlink.
// This creates a builder and also an empty document inside the builder
DocumentBuilder builder = new DocumentBuilder();

Shape shape = builder.InsertImage(ImageDir + "Hammer.wmf");
shape.HRef = "";
shape.Target = "New Window";
shape.ScreenTip = "Aspose.Words Support Forums";

builder.Document.Save(ArtifactsDir + "Image.InsertImageWithHyperlink.doc");
See Also