|
-
Sep 4th, 2002, 09:20 AM
#1
Thread Starter
New Member
Outlook Automation error
Hi,
Do I need Exchange server installed in my machine for the CDO objects to work properly? I dont have exchange installed in my machine. So when I tryrunning a code for displaying the outlook adress book from Vb using CDO 1.2 Library, I get the error "This program has performed Illegal operation". This closes the VB app itself.
Any thought?
Thanx
Sandeep
-
Sep 4th, 2002, 09:25 AM
#2
PowerPoster
Did you try to debug your program prior to asking this question? You must - there is no way arround. See what exactly is giving you a problem (or perhaps what you are doing wrong).
Roy
-
Sep 4th, 2002, 09:33 AM
#3
Frenzied Member
It should work with outlook, try the following
You could try to add a component to your form
goto Project Components and add a mark next to Microsoft MAPI controls 6.0
Add a MAPPISession control to your form and a MAPPIMessages control .
Then try to use them into your code.
rename them appropriate.
Don't you have to use oSession.SignOn
instead of oSession.Logon "", "", False, False
Hope this helps
Code:
If Question = Incomplete Then
AnswerNextOne
Else
ReplyIfKnown
End If
cu Swatty
-
Sep 4th, 2002, 09:45 AM
#4
Thread Starter
New Member
Outlook Automation Error
Hi,
Thanx a lot Swatty n Roy.
I'm creating a wrapper over CDO, so I cant use a component here. I would rather use CDO objects to achieve the same.
Even when I write a simple code, I get the error "This program has performed illegal operation"
The following code snippet generates the error I specified above.
Private Sub Command1_Click()
Dim oSession As MAPI.Session
Set oSession = New MAPI.Session
oSession.Logon "", "", False, False
msgbox oSession.CurrentUser
End Sub
Strangely I get this error only with some methods or properties. Also when I use the code to display address book I get the same error.
ie. oSession.Adressbook generate the same error.
Sandeep
-
Sep 4th, 2002, 09:56 AM
#5
PowerPoster
sandeep,
as swatty mentioned you may better use MAPI controls then explicitely declare an object variable. The problem could probably be that you may have MAPI related dll corrupted or outdated. See if this helps.
Roy
-
Sep 4th, 2002, 09:57 AM
#6
PowerPoster
Or perhaps use MS Outlook x.x object type library to create an e-mail app.
Cheers, Roy
-
Sep 4th, 2002, 10:17 AM
#7
Thread Starter
New Member
:(
Since I'm asked to develop it using CDO, i cant opt for outlook object model. I tried the same code in 2 different machines and I'm getting the same error. On 1 machine OS is XP pro and on the other it is Win 2k . When I keep the mouse poniter over the dl it gives the description CDO for 95 and NT. Will that be a problem?
Sandeep
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|