Results 1 to 3 of 3

Thread: [RESOLVED] [2008] Check if Outlook is already running

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Resolved [RESOLVED] [2008] Check if Outlook is already running

    I am currently using the code below to open outlook automatically.
    Code:
    Dim psInfo As New System.Diagnostics.ProcessStartInfo("OUTLOOK.EXE")
    psInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized
    Dim myProcess As Process = System.Diagnostics.Process.Start(psInfo)
    However, this simply opens a new instance regardless of whether it is already open or not.
    I'd like to check if there is an existing instance, and if so don't open outlook.

    How can I do this please ?

  2. #2
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    Re: [2008] Check if Outlook is already running

    Code:
    Dim procs() As Process = Process.GetProcessesByName("Outlook")
    If procs.Count > 0 Then MsgBox("Oulook is running")
    
    ' Obviously, each element in the procs() array will contain an outlook process

  3. #3

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: [2008] Check if Outlook is already running

    Thanks cicatrix I'll give this a go

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width