Sent mail with Outlook 03 (use Access 07)

bodylojohn

Registered User.
Local time
Today, 02:25
Joined
Dec 28, 2005
Messages
205
I have written an application containing a textbox where an email address is displayed. When the user clicks the send button the "new email" window of outlook openes and the email adres is displayed in the "to" textbox of outlook.

I use the following code:
Code:
Function EmailAdressToOutlook()

Dim objOL As Outlook.Application
Dim objOLMsg As Outlook.MailItem
Dim objOLRecip As Outlook.Recipient
Dim MyObject As Object
    Set MyObject = CodeContextObject
    Set objOL = CreateObject("Outlook.Application")
    Set objOLMsg = objOL.CreateItem(olMailItem)

    If Not IsNull(MyObject![Email]) Then
        With objOLMsg
            Set objOLRecip = .Recipients.Add(MyObject![Email])
            objOLRecip.Type = olto
            .Display
        End With
    End If

End Function

I also have the Microsoft Outlook 12.0 Object Library reference selected.
All this works great in outlook 2007.
But in outlook 2003 I get an error message.
How can I solve this. Obviously I can select only one outlook reference (there is also only the one mentioned above available).

Thanks in advance.
 
To change the Object Library reference, open any module and go to TOOLS/REFERENCES and check the appropriate Object. Look for any "Missing References".
 
Hello Martin,

Thanks for the quick reply.
I just dont get it to work,

How do I solve my problem when a user uses outlook 203 or another email programm?

Please help me.

If you change to late binding that should address the Outlook reference problem. And as for another email program...well you obviously can't send things through Outlook if they don't have it installed.
 
If you change to late binding that should address the Outlook reference problem. And as for another email program...well you obviously can't send things through Outlook if they don't have it installed.

Whats the best way to go about this?
 

Users who are viewing this thread

Back
Top Bottom