LarryE
Well-known member
- Local time
- Today, 02:57
- Joined
- Aug 18, 2021
- Messages
- 1,090
I have the following code:
which correctly opens Outlook but will not minimize it to the taskbar. Does anyone know why not?
Code:
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
Option Compare Database
Option Explicit
Dim result As LongPtr
result = ShellExecute(0, "open", "OUTLOOK.EXE", vbNullString, vbNullString, SW_SHOWMINIMIZED)