473,396 Members | 2,076 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,396 software developers and data experts.

Outlook automation help requested

I'm on A97 and have Outlook 2003 on the computer. There's some generic
code at Tony Toew's site and at MS and on the web that's very
similar....but I can't make it work. I want to use late binding but it
appears I'm not having much luck. The code works ONLY if Outlook is loaded.

I'm a bit unfamiliar with Outlook...been using Netscape for way too
long. When I start Outlook, it prompts me for a profile. How do you
handle that via Automation? Next, if Outlook is not loaded, the
CreateObject bombs out.

I suppose I could check for Outlook's class name and if Outlook isn't
loaded then simply tell the user to start Outlook first. But that's
kind of kludgy. I'm hoping there's a better way...and that you have the
solution. TIA! Below is the code I am hoping to get to work.

Dim olMailItem As Integer
Dim olTo As Integer
Dim olcc As Integer
Dim olbcc As Integer
Dim olImportanceHigh As Integer

olTo = 1
olcc = 2
olbcc = 3
olImportanceHigh = 2
olMailItem = 0

'Create the Outlook session.
Set objOutlook = GetObject(, "Outlook.Application") 'get reference

'if Outlook is already running.
If Err.Number = 429 Then 'Error 429
'occurs if Outlook is NOT running.
Err.Clear

'******here is where it bombs out****
Set objOutlook = CreateObject("Outlook.Application")

MsgBox Err.Number
If Err.Number = 429 Then
MsgBox "MS Outlook is not installed on your computer"
Exit Sub
End If
End If
...rest of code processes
Jul 26 '06 #1
0 1415

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MLH | last post by:
Is the following remotely correct? =DDE("C:\Program Files\Program Files\Outlook Express\OEmig50","Attachment","Name") I'm not sure that OEmig50.exe is the executable for OE. Anybody know? ...
2
by: Lauren Quantrell | last post by:
Using Outlook Automation, is there a way to insert a graphic in the body of an e-mail so that it appears at the top of an email? lq
10
by: John | last post by:
Hi When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am...
14
by: Gerhard | last post by:
I'm posting this again, as no answer to the first post.... I would like to integrate Outlook into my vb.net web page, so that when I send an email (which I can successfully do now), it shows up...
26
by: Tom Becker | last post by:
Is there a way, from Access, to programmatically click the Send and Receive button in Outlook?
5
by: Arno R | last post by:
Hi all, I need to get at specific (shared) agenda-data from MS outlook 2003. I need every day to get the scheduled 'appointments' for some rooms to Access. In Access I will show the...
1
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox...
1
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox...
0
by: madihamir | last post by:
Iam new to .net and have gotten assignment for make the class library to automate the outlook I have tried to done it but i've to make the Handlers also . Detecting an methods for receiving and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.