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

Posted on 2011-05-04
Last Modified: 2012-05-11
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                                          '
        Shell "C:\Program Files\Microsoft Office\Office12\outlook.exe", vbMinimizedFocus
    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?

Question by:kosenrufu
    1 Comment
    LVL 11

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now