Aspose::Cells::Hyperlink class
Contents
[
Hide
]Hyperlink class
Encapsulates the object that represents a hyperlink.
class Hyperlink
Methods
Method | Description |
---|---|
Delete() | Deletes this hyperlink. |
GetAddress() | Represents the address of a hyperlink. |
GetArea() | Gets the range of hyperlink. |
GetLinkType() | Gets the link type. |
GetScreenTip() | Returns or sets the ScreenTip text for the specified hyperlink. |
GetTextToDisplay() | Represents the text to be displayed for the specified hyperlink. The default value is the address of the hyperlink. |
Hyperlink(Hyperlink_Impl* impl) | Constructs from an implementation object. |
Hyperlink(const Hyperlink& src) | Copy constructor. |
IsNull() const | Checks whether the implementation object is nullptr. |
explicit operator bool() const | operator bool() |
operator=(const Hyperlink& src) | operator= |
SetAddress(const U16String& value) | Represents the address of a hyperlink. |
SetAddress(const char16_t* value) | Represents the address of a hyperlink. |
SetScreenTip(const U16String& value) | Returns or sets the ScreenTip text for the specified hyperlink. |
SetScreenTip(const char16_t* value) | Returns or sets the ScreenTip text for the specified hyperlink. |
SetTextToDisplay(const U16String& value) | Represents the text to be displayed for the specified hyperlink. The default value is the address of the hyperlink. |
SetTextToDisplay(const char16_t* value) | Represents the text to be displayed for the specified hyperlink. The default value is the address of the hyperlink. |
~Hyperlink() | Destructor. |
Fields
Field | Description |
---|---|
_impl | The implementation object. |
Examples
Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
//Adding a new worksheet to the Workbook object
workbook.GetWorksheets().Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.GetWorksheets().Get(0);
//Adding a hyperlink to a URL at "A1" cell
int index = worksheet.GetHyperlinks().Add(u"A1", 1, 1, u"http://www.aspose.com");
//Getting a Hyperlink by index.
Hyperlink hyperlink = worksheet.GetHyperlinks().Get(index);
//Setting display text of this hyperlink.
hyperlink.SetTextToDisplay(u"Aspose");
//Saving the Excel file
workbook.Save(u"book1.xls");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells
- Library Aspose.Cells for C++