Skip to main content

SetAddress

Sets the address of the target document.

Syntax​

expression.SetAddress(sAddress);

expression - A variable that represents an ApiHyperlink class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
sAddressRequiredstringThe hyperlink address.

Returns​

This method doesn't return any data.

Example​

Set a new address for a hyperlink.

// Useful for changing the URL of an existing hyperlink in a cell.

// Set a new address for a hyperlink.

let worksheet = Api.GetActiveSheet();
worksheet.SetHyperlink("A1", "https://onlyoffice.com", null, "ONLYOFFICE", "Visit ONLYOFFICE");

let hyperlink = worksheet.GetHyperlinks()[0];
hyperlink.SetAddress("https://helpcenter.onlyoffice.com");

worksheet.GetRange("A3").SetValue("New address: " + hyperlink.GetAddress());