Vincent88
Active Member
- Joined
- Mar 5, 2021
- Messages
- 382
- Office Version
- 2019
- Platform
- Windows
- Mobile
HI Guys, Any idea how to maximize the outlook application when open from Excel.
VBA Code:
Sub Is_Outlook_Running_Open_App()
'Declare Variables to Check Get Instance of Outlook Object
Dim objOutlook As Object
'Initialize
Set objOutlook = Nothing
'Get Instance of Object
'Getobject will give error if it did not find the app.
'Sp, On Error is required all the time
On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0
'Check if Outlook is Running
If objOutlook Is Nothing Then
'Outlook is not Running - Open Outlook App
VBA.Shell ("Outlook")
Else
'MsgBox "Outlook is already Running in Your Machine"
Dim objOL As Object
Dim objExplorer As Object
Set objOL = GetObject(, "Outlook.Application")
Set objExplorer = objOL.ActiveExplorer
Set objExplorer.CurrentFolder = objOL.GetNamespace("MAPI").GetDefaultFolder(6)
objExplorer.Activate