![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: click, excel, file, form, hyperlink, link, opens, outlook |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I need to have a link on an Outlook VBA form that links and opens an
excel file, does anyone know of a way to do this? Have seen links to internet explorer but not opening a file on a shared network drive. Thanks John |
| Ads |
|
#2
|
|||
|
|||
|
See my response to your post in another group.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/article.aspx?id=54 wrote in message ups.com... I need to have a link on an Outlook VBA form that links and opens an excel file, does anyone know of a way to do this? Have seen links to internet explorer but not opening a file on a shared network drive. Thanks John |
|
#3
|
|||
|
|||
|
The code to open a file needs the following Win32 API declaration in the
General Declarations section of a new Module (you can't put it in the code behind the UserForm): Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String _ , ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Then you can launch the file like this: Dim varRet As Variant varRet = Shell("""C:\Program Files\Microsoft Office\Office12\EXCEL.EXE"" ""C:\Temp\myworkbook.xls""", vbNormalFocus) Change 12 in the file path to 11 if you are using Office 2003. The trickiest part is making the user think he's clicking on a hyperlink. None of the built-in controls are satisfactory for replicating a true "URL clicking experience". For example, you'd have to manually make the text blue and underlined and write additional code to change the cursor to a hand-with-finger during a MouseOver event for the control. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: I need to have a link on an Outlook VBA form that links and opens an excel file, does anyone know of a way to do this? Have seen links to internet explorer but not opening a file on a shared network drive. Thanks John |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Everytime i click a link in O/E email, it opens a 'new' browser window? | JethroUK© | Outlook Express | 17 | April 11th 07 09:34 AM |
| Clicking hyperlink in Outlook opens dozens of blank IE pages. | Siddartha | Outlook - General Queries | 1 | January 11th 07 03:14 PM |
| Can I link an excel hyperlink to a public contacts folder or conta | Jordan Mullet | Outlook - Using Contacts | 1 | June 8th 06 06:21 PM |
| Click link opens AOL instead of Firefox | kathrynatgwens | Outlook - General Queries | 1 | January 31st 06 05:53 PM |
| 2nd request - Click link opens AOL instead of Firefox | KathrynBassett | Outlook - General Queries | 3 | January 30th 06 05:44 PM |