473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Checking if Outlook is running within a VB.Net Application

I have a created a program that checks if outlook is already open and if not then the code will restart Outlook. My problem now is that when the code checks if the program is running it does not seem to be working it does not open outlook when it is not running.I am using the following piece of code to check.

Expand|Select|Wrap|Line Numbers
  1.  If Process.GetProcessesByName("OutLook").Length < 1 Then
  2.             'restarts the Process
  3.             Process.Start("OutLook.exe")
  4.         End If
Is that the process name for outlook if not what is it? What am I doing wrong?
Sep 8 '08 #1
3 9902
Curtis Rutland
3,256 Expert 2GB
You can't just specify a program name like that, you need to provide the full path:
C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE
That's the path to outlook 2007 on my machine. (Office 12 = office 2007) Find it on your machine and change the Start parameter to the whole path.
Sep 8 '08 #2
You can't just specify a program name like that, you need to provide the full path:


That's the path to outlook 2007 on my machine. (Office 12 = office 2007) Find it on your machine and change the Start parameter to the whole path.
When I specify the full name as you have suggested the code does not seem to see that the program is already running and opens many instances of outlook every time the process is run. So how can i stop the program from openning more than one instance of outlook 2000?
Sep 10 '08 #3
Curtis Rutland
3,256 Expert 2GB
Well, what I meant was, you should still look for the process "OUTLOOK.EXE" but when it isn't found, start it with the full path.
Sep 10 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Chuck Farah | last post by:
I am unsuccessfullly trying to display an outlook email from a vb web forms (.net) outlook 2002 #1. is it possible to use outlook client email from a web form using the outlook object model...
3
by: deko | last post by:
When adding Outlook Appointment Items from Access, should I use: Set ol = New Outlook.Application --or-- Set ol = CreateObject("Outlook.Application") Outlook seems to crash either way. The...
2
by: John | last post by:
Hi I am using outlook to display and send new mail message from within vb.net. What is the correct way to close outlook after I am done? If I use outlookapp.quit then any running outlook copy...
0
by: Scott H | last post by:
Hi All, I've got a bit a problem I can't seem to work out. Using the code listed below, the program runs fine within the VB dev environment, but once built and running outside of VB, it doesn't...
26
by: Tom Becker | last post by:
Is there a way, from Access, to programmatically click the Send and Receive button in Outlook?
0
by: Slawomir Nasiadka | last post by:
Hi, I'am new to this group so I would like to say "Hello" everyone and here is my problem: I'm writing a simple application (code is at the end of this message) witch would list all mails...
3
by: bobdydd | last post by:
Hi Everybody Access 2000, Outlook 2000 Windows XP I am running the code below to open Microsoft Outlook from a Command Button. It works fine until I tried it on a machine that has Office...
23
by: andyoye | last post by:
How can I launch Outlook on users machines when they click a button on a web form (InfoPath)? Thanks
3
OuTCasT
by: OuTCasT | last post by:
Hi I have created an asp.net project that exports items from datagridview to and outlook calendar This is the code that i have used.. Dim body As String Dim ends As String ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.