Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

commandline to open outlook minimized

OPTION EXPLICIT

CONST PATH_TO_OUTLOOK = """C:Program Files (x86)Microsoft OfficeOffice14OUTLOOK.EXE"""
CONST SHOW_MAXIMIZED = 3
CONST MINIMIZE = 1

DIM shell, outlook

SET shell = WScript.CreateObject("WScript.Shell")

' Open Outlook
shell.Run PATH_TO_OUTLOOK, SHOW_MAXIMIZED, FALSE

ON ERROR RESUME NEXT

' Grab a handle to the Outlook Application and minimize 
SET outlook = WScript.CreateObject("Outlook.Application")
WScript.Sleep(100)
outlook.ActiveExplorer.WindowState = SHOW_MAXIMIZED

' Loop on error to account for slow startup in which case the
' process and/or the main Outlook window is not available
WHILE Err.Number <> 0
  Err.Clear
  WScript.Sleep(100)
  SET outlook = NOTHING
  SET outlook = WScript.CreateObject("Outlook.Application")
  outlook.ActiveExplorer.WindowState = MINIMIZE
WEND

ON ERROR GOTO 0

SET outlook = NOTHING
SET shell = NOTHING
Comment

PREVIOUS NEXT
Code Example
Csharp :: windows form toolbox enter key 
Csharp :: ef null check 
Csharp :: split array into pieces of x length c# 
Csharp :: FileSystemEventHandler raised twice 
Csharp :: extension method c# 
Csharp :: dotnet.com 
Csharp :: generate prime numbers 
Csharp :: index in foreach in c# 
Csharp :: c# get first word of string 
Csharp :: javas 
Csharp :: c# loop backwards 
Csharp :: protected override void OnExiting(Object sender, EventArgs args) { base.OnExiting(sender, args); Environment.Exit(Environment.ExitCode); } 
Csharp :: convert array to list c# 
Csharp :: c# for loop last iteration 
Csharp :: how to resize a panel unity 
Csharp :: Nullable Types unity 
Csharp :: how disable the back off a panel C# 
Csharp :: c# an object on upper level cannot be added to an object 
Html :: html euro symbol 
Html :: font awesome icon 6 cdn 
Html :: bootstrap select box arrow not visible 
Html :: html chevron 
Html :: python jupyter markdown color 
Html :: target _blank 
Html :: input hidden 
Html :: bootstrap center button horizontally 
Html :: svg circle 
Html :: twig join 
Html :: ver pdf en html 
Html :: link phone number mail html 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =