Results 1 to 7 of 7

Thread: [RESOLVED] how to know if outlook is running or not?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    59

    Resolved [RESOLVED] how to know if outlook is running or not?

    Haloo

    I m new here, and I want to make a program that only run if outlook2002 is not open. so if outlook is open it will abort.
    how to check if the outlook office is open or not
    can somebody tell me the syntax how to recognize wether outlook is running or not.

    thanks a lot

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: how to know if outlook is running or not?

    Use this function to check
    VB Code:
    1. Private Function OutlookRunning() As Boolean
    2.     On Error GoTo NotRunning
    3.     Dim OTL As Object
    4.     Set OTL = GetObject(, "Outlook.Application")
    5.     Set OTL = Nothing
    6.     OutlookRunning = True
    7.     Exit Function
    8. NotRunning:
    9.     Set OTL = Nothing
    10.     OutlookRunning = False
    11. End Function
    12.  
    13. Private Sub Form_Load()
    14.     If Not OutlookRunning Then
    15.         MsgBox "Its Not Running"
    16.     Else
    17.         MsgBox "Its Running"
    18.     End If
    19. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    59

    Re: how to know if outlook is running or not?

    ok i will try that.. thanks..
    i can not make it at the moment because i dont have vb compiler

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: how to know if outlook is running or not?

    you should be able to run that in an office app.. (like excel)
    Just change the form_open to something else.... for testing
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    59

    Re: how to know if outlook is running or not?

    ok thank a lot its help me a lot.. can u also tell me the syntax wether the internet connection is available or not..
    thanks for the help

    btw if i compile and run it from excel.. if its possible to make it run at start up so the program will listen to internet availability until it run other task..

    thanks

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: how to know if outlook is running or not?

    you can really "compile" and run from excel..
    I just told u that so u can test it...

    u will need VB to compile it to an exe...

    as far as the internet.. you'll have to ping a server or something to test for the connection..
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Member
    Join Date
    Jul 2006
    Posts
    59

    Re: how to know if outlook is running or not?

    ah ok then

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