Extraoutlook works great, so great in fact I wrote an interface for the command line, I currently use it to open 22 Exchange profiles simultaneously and update their ost files for keeping a local backup
Code compiled in Autoit
https://www.autoitscript.com/site/autoit/
Program has four options
- Run a single Profile (runs a single profile at a time )
- Add the Auto start (add Profile , user and pass to an ini file )
- Run Autostart (opens multiple outlook instances in succession)
- Run Autoclose (closes all instances of Outlook)
The code:
;************************************************************
#RequireAdmin
#include <MsgBoxConstants.au3>
#include <guiconstants.au3>
#include <string.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
Global $Font = 'Verdana'
Global $Outlook = 'C:\Program Files (x86)\Microsoft Office\Office14\OUTLOOK.EXE' ;Office 2010
Global $ExtraOutlook = @SystemDir & "\Extraoutlook.exe"
Global $Process = "OUTLOOK.exe"
Global $IniFile = "outlookprofiles.ini"
Global $Radio[4]
FileInstall("Extraoutlook.exe",@SystemDir & "\Extraoutlook.exe",0)
If Not FileExists (@ScriptDir & '\' & $IniFile) Then
Iniwrite($IniFile, "START","Count","0")
Iniwrite($IniFile, "PROFILE","1","")
Iniwrite($IniFile, "USER","1","")
Iniwrite($IniFile, "PASS","1","")
Else
_Start()
EndIf
_Start()
Func _Start()
$WinMain = GuiCreate('Outlook', 180,215 )
GUISetFont(7,300,'' ,$font)
$Input1 = GUICtrlCreateInput('Profile',5,15,165,25)
$Input2 = GUICtrlCreateInput('User',5,45,165,25)
$Input3 = GUICtrlCreateInput('Password',5,75,165,25)
$Radio[0] = GUICtrlCreateRadio("", 5, 105, 15, 15)
$Radio[1] = GUICtrlCreateRadio("", 5, 125, 15, 15)
$Radio[2] = GUICtrlCreateRadio("", 5, 145, 15, 15)
$Radio[3] = GUICtrlCreateRadio("", 5, 165, 15, 15)
$label = GUICtrlCreateLabel("Start Outlook Profile", 25, 105,150,25);
$label = GUICtrlCreateLabel("Add to Autostart", 25, 125,150,25)
$label = GUICtrlCreateLabel("Run Autostart", 25, 145,150,25)
$label = GUICtrlCreateLabel("Run Autoclose", 25, 165,150,25)
$ButtonOK = GuiCtrlCreateButton('OK', 5,190,80,20)
$ButtonCancel = GuiCtrlCreateButton('Cancel', 90,190,80,20)
GUICtrlSetState($Radio[0],$GUI_CHECKED)
GuiCtrlSetState($Input2,$GUI_DISABLE)
GuiCtrlSetState($Input3,$GUI_DISABLE)
GUISetState(@SW_SHOW)
Local $Count = IniRead($Inifile,"START","Count","")
Local $a = 1
Local $msg = GUIGetMsg()
While $a = 1 ;Infinite Loop
Switch GUIGetMsg()
Case $ButtonOK
If _IsChecked($Radio[1]) Then
IniWrite ($IniFile,"PROFILE",$Count +1,GUICtrlRead($Input1))
IniWrite ($IniFile,"USER",$Count +1,GUICtrlRead($Input2))
IniWrite ($IniFile,"PASS",$Count +1,GUICtrlRead($Input3))
IniWrite ($IniFile,"START","Count",$Count +1)
MsgBox(64,"New Profile Added","Profile Name: " & GUICtrlRead($Input1) & @CRLF & "User: " & GUICtrlRead($Input2) & @CRLF & "Password: " & GUICtrlRead($Input3),10)
Else
If _IsChecked($Radio[0]) Then
If GUICtrlRead($Input1) <> "Profile" Then
Run(@ComSpec & " /c " & $ExtraOutlook & " " & '"' & $Outlook & '"' & " " & "/profile " & $Input1, "", @SW_HIDE)
Else
MsgBox(64,"","Please Enter a valid Profile name.",5)
EndIf
Else
If _IsChecked($Radio[2]) Then
_Autostart()
Else
If _IsChecked($Radio[3]) Then
_Autoclose()
EndIf
EndIf
EndIf
EndIf
Case $Radio[0]
GuiCtrlSetState($Input1,$GUI_ENABLE)
GuiCtrlSetState($Input2,$GUI_DISABLE)
GuiCtrlSetState($Input3,$GUI_DISABLE)
Case $Radio[1]
GuiCtrlSetState($Input1,$GUI_ENABLE)
GuiCtrlSetState($Input2,$GUI_ENABLE)
GuiCtrlSetState($Input3,$GUI_ENABLE)
Case $Radio[2]
GuiCtrlSetState($Input1,$GUI_DISABLE)
GuiCtrlSetState($Input2,$GUI_DISABLE)
GuiCtrlSetState($Input3,$GUI_DISABLE)
Case $Radio[3]
GuiCtrlSetState($Input1,$GUI_DISABLE)
GuiCtrlSetState($Input2,$GUI_DISABLE)
GuiCtrlSetState($Input3,$GUI_DISABLE)
Case $ButtonCancel ; Exit the loop.
Exit
EndSwitch
WEnd
EndFunc
Func _IsChecked($idControlID)
Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc
Func _Autostart()
Local $a = 1
While $a > 0
If IniRead($Inifile,"PROFILE",$a,"") <> "" Then
Run(@ComSpec & " /c " & $ExtraOutlook & " " & '"' & $Outlook & '"' & " " & "/profile " & IniRead($Inifile,"PROFILE",$a,""), "", @SW_HIDE)
Sleep (15000)
;Msgbox(0,"",IniRead($Inifile,"PROFILE",$a,""),3)
Send("{DOWN}")
Send("{DOWN}")
Send(IniRead($Inifile,"USER",$a,""))
Send("{TAB}")
Send(IniRead($Inifile,"PASS",$a,""),1)
Send("{TAB}")
Send("{TAB}")
Send("{ENTER}")
Sleep (25000) ;
$a = $a +1
Else
Exit
EndIf
WEnd
EndFunc
Func _AutoClose()
$a = 1
Do
If ProcessExists($Process) Then
ProcessClose($Process)
Else
Exit
EndIf
Sleep(1000)
$a = $a +1
Until $a = 64
EndFunc
;************************************************************
Not worked for me with Outlook 2010 / Win7 Pro. Outlook open with the last profile you passed in argument /profile "myprofile". First time you run extraoutlook it open outlook with the profile you asked, and the second time, the first outlook profile instance change automaticaly to the second. Worked with earlier office version. Another idea? – Christophe Trevisani Chavey – 2011-05-02T17:36:46.107