Hello Karen,
Hyperlinks are not avaibale to the UserForm in VBA. Since you are
launching Word documents from the command button click event, you can
use an API call to have the system open the document. Using a few more
API calls, it is easy to get the Form to stay on top of all the other
documents. Add a VBA module to your workbbok and copy the code between
the lines into it.
________________________________________________________
'Returns the Window Handle of the Active Window
Declare Function GetActiveWindow _
Lib "user32.dll" () As Long
Private Declare Function SetWindowPos _
Lib "user32.dll" _
(ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
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
Public Sub OpenFile(ByVal File_Name As String)
Dim RetVal
RetVal = ShellExecute(0&, "open", File_Name, vbNullString,
vbNullString, 1)
End Sub
Public Sub KeepFormOnTop()
Dim hWnd As Long
Dim RetVal
Const HWND_NOTOPMOST = -2
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
hWnd = GetActiveWindow()
RetVal = SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE)
End Sub
________________________________________________________
To the Command Button Click events add the following line of code:
(You must include the Directory path along with the file name)
Be sure to change the Directory and File name to what you are using.
Call OpenFile("C:\Documents and Settings\Karen\My Documents\Document
1.doc")
To the USerForm Activate event add this line of code:
Call KeepFormOnTop
Sincerely,
Leith Ross

Signature
Leith Ross
assertec@aapt.net.au - 15 Feb 2006 04:56 GMT
Thanks for this Leith - it all worked fine.
Regards
Karen