1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
Public WithEvents myControl As Office.CommandBarButton
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)
Private Declare Function FindWindow& Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String)
Private Const SW_SHOWNORMAL = 1
Private Const SW_RESTORE As Long = 9
Private Const gcClassnameMSOutlook = "rctrl_renwnd32"
Private Sub myControl_Click(ByVal Ctrl As Office.CommandBarButton, CancelDefault As Boolean)
ShellExecute FindWindow(gcClassnameMSOutlook, vbNullString), vbNullString, Ctrl.Tag, vbNullString, vbNullString, SW_RESTORE
End Sub |
Partager