Question : VBA Email via Access and Outlook EXPRESS MailItem Object???

Does anyone know of a way to automate sending messages from Access 2000 via Outlook EXPRESS, similar to the following in Outlook?:

    Dim strRecipient As String
    Dim strSubject As String
    Dim objMailItem As Outlook.MailItem
   
    Dim olkApp As Outlook.Application
    Dim olkNameSpace As NameSpace
   
   
    Set olkApp = New Outlook.Application
   
    Set olkNameSpace = olkApp.GetNamespace("MAPI")
    Set objMailItem = olkApp.CreateItem(olMailItem)
   
    With objMailItem
        .To = Me!EMAIL
        .Recipients.ResolveAll
        .ReadReceiptRequested = True
        .Subject = "Payment Overdue"
        '.Body = "Here is the body"
        .Display
        '.Attachments.Add ("C:\Test.txt")
        '.Attachments.Add (D:\AnotherTest.doc")
    End With
   
    Set objMailItem = Nothing
    Set olkNameSpace = Nothing
    Set olkApp = Nothing
-------------------------------------------------
Many Thanks, Jacob

Answer : VBA Email via Access and Outlook EXPRESS MailItem Object???

If you are using ClickYes then you can utilize CDO to send via the local e-mail client.  Here's a VBS sample of using CDO with the default e-mail client.

OM Gang
1:
2:
3:
4:
5:
6:
7:
8:
9:
Dim objMessage
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Testing from OM Gang"
objMessage.From = "[email protected]"
objMessage.To = "[email protected]"
objMessage.TextBody = "This is a test message"
objMessage.Send
 
Set objMessage = Nothing
Open in New Window Select All
Random Solutions  
 
programming4us programming4us