-
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
-
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
-
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
-
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
-
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
-
Or perhaps use MS Outlook x.x object type library to create an e-mail app.
Cheers, Roy
-
:(
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