Outlook 2007 VB6

J

Johnny E Jensen

Hello Group

I'ev made a rather large application in VB6 and wanted to test it against
Outlook 2007, the appliation crashes when it uses an object like this: (all
works fine with OL 2000-2003)


Private WithEvents m_OLMail As Outlook.MailItem

Public Function InitMail(Receiver as String) As Boolean
Dim olapp As Outlook.Application

On Error GoTo ErrHandler

InitMail = False
Set olapp = New Outlook.Application
Set m_OLMail = olapp.CreateItem(olMailItem) <----- After this it crashes
and VB6 ends
m_OLMail.To = Receiver
m_OLMail.Display

InitMail = True

ExitPoint:
On Error GoTo 0
Exit Function

ErrHandler:
Resume ExitPoint
End Function

Any suggestions?

Kind regards
Johnny Jensen
 
K

Ken Slovak - [MVP - Outlook]

It works OK here in VB6. I made a quick exe project and used your code. I
substituted an email address for the To string. No problems or errors.

Are you running the RTM version of Outlook 2007?

What is your A-V status and trust settings for code?

Can you trap any errors?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top