• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

How to modify this code so the profile is automatically selected?

Public Sub OutlookStart()
 
    On Error Resume Next
 
    Dim objOL       As Object
   
    'check if Outlook is running
    Set objOL = GetObject(, "Outlook.Application")
   
    'on error start Outlook
    If Err.Number <> 0 Then                                          '
        Err.Clear
        Shell "C:\Program Files\Microsoft Office\Office12\outlook.exe", vbMinimizedFocus
        DoEvents
    End If
 
    Set objOL = Nothing
 
End Sub


Currently I configured Outlook to prompt for profile. I want to automatically select the profile and bypass the prompt window. How can this be done with VBA?

Thanks
0
kosenrufu
Asked:
kosenrufu
1 Solution
 
LambertHeenanCommented:
It should work if you use a profile switch in the command line command

Shell "C:\Program Files\Microsoft Office\Office12\outlook.exe" & " /profile profilename", vbMinimizedFocus

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now