Open Outlook maximized in VBA

Vincent88

Active Member
Joined
Mar 5, 2021
Messages
382
Office Version
  1. 2019
Platform
  1. Windows
  2. 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
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
try to
" Drag the window's upper left corner over to the upper left corner of the screen. Drop the window there .. then drag the edge of the lower right of the window down to the lower right corner. Close Outlook.
 
Upvote 0
Hi, I prefer to do it thru VBA instead of doing manually. Time consumed !
 
Upvote 0
I didn't explain good enough
Run macro first than adjust outlook
Close outlook and try macro again
After adjusting once you shouldn’t have to do it more
 
Upvote 0
Hi AC PORTA VIA,
Is there any option other than this ?
 
Upvote 0
Not that I know , however when I ran your macro I got outlook open but minimized
After I did manual resize and went back to you your macro outlook is opening maximized each time I run macro
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,186
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top