If you need clickable links in a custom form, you can use VBScript code and a Label field or Command buttons to make clickable links.
Note: The Contact form has two hyperlink fields - WebPage and FTPSite. Add them to your custom form from the Field Chooser to a form page.
If you need more than two links, you can use code behind the form page to make a label clickable.
Code behind a Label Control
Believe it or not, a label control on an Outlook form supports a Click event. So, you can put the text for the hyperlink in the control's caption and use code like this to launch the link in the browser when the user clicks the label. You could use a CommandButton control or store the URL in another field, other than the control's caption, or even generate it programmatically.
The code samples below work with your default web browser.
The first hyperlink in this screenshot uses just the label, formatted as a hyperlink. To open the second link, you need to click near Open URL. The URL is editable in the text box.
Sub Label1_Click() strURL = Item.GetInspector.ModifiedFormPages("P.2").Controls("Label1").Caption CreateObject("WScript.Shell").Run(strURL) End Sub
Or skip the controls and just use the URL in the code. The advantage in using the control caption is if you need to change the URL, you only need to edit the caption, not the VBScript.
Sub Label1_Click() CreateObject("WScript.Shell").Run("https://www.slipstick.com/developer/custom-form/create-hyperlink-outlook-form/") End Sub
In this code sample, the label is clicked to open a URL in a text field. This method is useful when you need a different link for each contact. In the Open URL example in my screenshot above, I made the label field large and placed the text box over it. This allows the user to click anywhere near the URL (but not inside the black lines)
Sub Label2_Click() strURL = Item.GetInspector.ModifiedFormPages("P.2").Controls("TextBox1").Value CreateObject("WScript.Shell").Run(strURL) End Sub
You can format the label to show the link as blue and underlined, so users will know to click on it. To use the name of the page in the caption, put the hyperlink in the control's Tag property, changing the code above to use Tag instead of Caption.
The "Click here to open hyperlink" tool tip is in the ControlTipText property (in Advanced Properties).