Hello
I found this code.. and i want to adapt it to an outlook toolbar button...
but!!
userform1 does not have hwnd
What should I do??
CODE BY MarkT ... VBFORUM
VB Code:
Option Explicit Private 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 Const SW_SHOWNORMAL = 1 Private Sub cmdRun_Click() On Error GoTo ErrRun With cdbRun .CancelError = True .DialogTitle = "Choose a file to run" .ShowOpen End With ShellExecute Me.hwnd, vbNullString, cdbRun.FileName, vbNullString, "C:\", SW_SHOWNORMAL ErrRun: End Sub
Thanks
Seahag




Reply With Quote