Solved

Inserting Hyperlink into Custom Outlook Form by EndUser

Posted on 2009-04-03
6
388 Views
Last Modified: 2013-12-26
I have an outlook form with multiple text boxes.  I need the end user that uses this form to be able to insert a hyperlink to a file on the network.  Is there a way to enable hyperlinking on a text box in a Custom Outlook Form.
0
Comment
Question by:commeng
  • 3
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
Hi, commeng.  

There's no way I know of to get a hyperlink to behave as a hyperlink in a textbox.  If the textbox will only contain the hyperlink string, then you can add a command button next to the textbox and use its click event to launch the URL in the textbox.  
0
 

Author Comment

by:commeng
Comment Utility
OK, how would I write the code for the command button?
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
This will do it.  The code assumes that the name of the command button is "CommandButton1".
Function CommandButton1_Click()

    Dim objPage, objControl, varValue, objShell

    'Change the page name on the next line'

    Set objPage = Item.GetInspector.ModifiedFormPages("P.2")

    'Change the control name on the next line'

    Set objControl = objPage.Controls("TextBox1")

    varValue = objControl.Value

    If varValue <> "" Then

        Set objShell = CreateObject("WScript.Shell")

        objShell.Exec "explorer.exe " & varValue

    End If

    Set objPage = Nothing

    Set objControl = Nothing

    Set objShell = Nothing

End Function

Open in new window

0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Closing Comment

by:commeng
Comment Utility
I was so close to having that on my own.  :D  I was doing a Sub not a Function, guess I will know for next time.  Thank you so much!
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
You're welcome.  Glad I could help out.
0
 
LVL 12

Expert Comment

by:Hairbrush
Comment Utility
Instead of the normal text box you could try using a Rich Text Box.  This page has a control that you could use that is based on a rich text box but with clickable hyperlinks: http://www.martin2k.co.uk/vb6/tips/vb_39.php

(Once you have registered the control, in the forms designer In the toolbox, right click and select Custom Controls, then scroll down the list to select the control.)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now