CreateURL method
Returns a fully qualified and optionally canonicalized representation of the hyperlink's absolute address.
Version added
5.0
Syntax
| |
strRet |
String. A fully qualified URL representation of a hyperlink. |
object |
Required. An expression that returns a Hyperlink object. |
intExpression |
Required Integer. True (non-zero) if canonical form; otherwise, False (0). |
Remarks
The CreateURL method of the Hyperlink object can be used to resolve relative URLs against a hyperlink's base address.
When you use the canonical form, the CreateURL method applies URL canonicalization rules to the hyperlink. Only spaces are URL encoded during canonicalization. Port 80 is assumed for HTTP URLs and is removed during canonicalization. The URL "http://www.microsoft.com:80/" is returned as "http://www.microsoft.com/", whereas http://www.microsoft.com:1000/" is unchanged.
Example
Here are some examples of results of the CreateURL method:
Address = "http://www.microsoft.com/"
CreateURL(False) returns "http://www.microsoft.com/"
Address = "C:\My Documents\Spreadsheet.XLS"
CreateURL(False) returns "file://C:\My Documents\Spreadsheet.XLS"
CreateURL(True) returns "file://C:\My%20Documents\Spreadsheet.XLS"
Relative path example:
Assume : Document.HyperlinkBase = "http://www.microsoft.com/bar/"
Address = "../file.htm"
CreateURL(False) returns "http://www.microsoft.com/file.htm"