|
Question : I would like to prevent two or more instances of outlook being open at same time
|
|
How do I prevent multiple instances of outlook (same profile) being open at same time - sometimes impatient users click icon several times nothing I say will prevent that so what can I do?
Thank you
David
|
|
Answer : I would like to prevent two or more instances of outlook being open at same time
|
|
I think either you sign some code yourself, or your users contend with "this session has macros - enable them?" message each time..
Perhaps modifying their shortcut to point to OLSession.vbs...
'OLSession.vbs Const olFolderInbox = 6 strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_Process Where Name = 'outlook.exe'")
If colItems.Count = 0 Then Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") Set objFolder = objNamespace.GetDefaultFolder(olFolderInbox) objFolder.Display Else MsgBox "Please be patient, Outlook is still loading...", vbOKOnly, "What's the hurry?" wscript.quit End If
Set objFolder = Nothing Set objNamespace = Nothing Set objOutlook = Nothing wscript.quit
|
|
|