FieldHyperlink Class
Implements the HYPERLINK field
Inheritance Hierarchy

Namespace: Aspose.Words.Fields
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
Syntax
public class FieldHyperlink : Field

The FieldHyperlink type exposes the following members.

Constructors
  NameDescription
Public methodFieldHyperlink
Initializes a new instance of the FieldHyperlink class
Properties
  NameDescription
Public propertyCode exampleAddress
Gets or sets a location where this hyperlink jumps.
Public propertyCode exampleDisplayResult
Gets the text that represents the displayed field result.
(Inherited from Field.)
Public propertyCode exampleEnd
Gets the node that represents the field end.
(Inherited from Field.)
Public propertyCode exampleFormat
Gets a FieldFormat object that provides typed access to field's formatting.
(Inherited from Field.)
Public propertyCode exampleIsDirty
Gets or sets whether the current result of the field is no longer correct (stale) due to other modifications made to the document.
(Inherited from Field.)
Public propertyCode exampleIsImageMap
Gets or sets whether to append coordinates to the hyperlink for a server-side image map.
Public propertyCode exampleIsLocked
Gets or sets whether the field is locked (should not recalculate its result).
(Inherited from Field.)
Public propertyCode exampleLocaleId
Gets or sets the LCID of the field.
(Inherited from Field.)
Public propertyCode exampleOpenInNewWindow
Gets or sets whether to open the destination site in a new web browser window.
Public propertyCode exampleResult
Gets or sets text that is between the field separator and field end.
(Inherited from Field.)
Public propertyCode exampleScreenTip
Gets or sets the ScreenTip text for the hyperlink.
Public propertyCode exampleSeparator
Gets the node that represents the field separator. Can be null.
(Inherited from Field.)
Public propertyCode exampleStart
Gets the node that represents the start of the field.
(Inherited from Field.)
Public propertyCode exampleSubAddress
Gets or sets a location in the file, such as a bookmark, where this hyperlink jumps.
Public propertyCode exampleTarget
Gets or sets the target to which the link should be redirected.
Public propertyCode exampleType
Gets the Microsoft Word field type.
(Inherited from Field.)
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodCode exampleGetFieldCode
Returns text between field start and field separator (or field end if there is no separator). Both field code and field result of child fields are included.
(Inherited from Field.)
Public methodCode exampleGetFieldCode(Boolean)
Returns text between field start and field separator (or field end if there is no separator).
(Inherited from Field.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodNeedStoreOldResultNodes (Overrides FieldNeedStoreOldResultNodes.)
Public methodCode exampleRemove
Removes the field from the document. Returns a node right after the field. If the field's end is the last child of its parent node, returns its parent paragraph. If the field is already removed, returns null.
(Inherited from Field.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodCode exampleUnlink
Performs the field unlink.
(Inherited from Field.)
Public methodCode exampleUpdate
Performs the field update. Throws if the field is being updated already.
(Inherited from Field.)
Public methodCode exampleUpdate(Boolean)
Performs a field update. Throws if the field is being updated already.
(Inherited from Field.)
Remarks
When selected, causes control to jump to the location such as a bookmark or a URL.
Examples
Shows how to insert HYPERLINK fields.
[C#]

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a hyperlink with a document builder
FieldHyperlink fieldHyperlink = (FieldHyperlink)builder.InsertField(FieldType.FieldHyperlink, true);

// When link is clicked, open a document and place the cursor on the bookmarked location
fieldHyperlink.Address = MyDir + "Field.HyperlinkDestination.docx";
fieldHyperlink.SubAddress = "My_Bookmark";
fieldHyperlink.ScreenTip = "Open " + fieldHyperlink.Address + " on bookmark " + fieldHyperlink.SubAddress + " in a new window";

builder.Writeln();

// Open html file at a specific frame
fieldHyperlink = (FieldHyperlink)builder.InsertField(FieldType.FieldHyperlink, true);
fieldHyperlink.Address = MyDir + "Field.HyperlinkDestination.html";
fieldHyperlink.ScreenTip = "Open " + fieldHyperlink.Address;
fieldHyperlink.Target = "iframe_3";
fieldHyperlink.OpenInNewWindow = true;
fieldHyperlink.IsImageMap = false;

doc.UpdateFields();
doc.Save(ArtifactsDir + "Field.Hyperlink.docx");
See Also