sending email from Access

  • Follow


I use reference to Microsoft outlook 12.0 Object Library. (Access
2007)

Dim olApp As Outlook.Application
    Dim objMail As Outlook.MailItem
    Dim ctlBody As String

    Set olApp = Outlook.Application
    Set objMail = olApp.CreateItem(olMailItem)

    Set objMail = Nothing
    Set olApp = Nothing

The above code has no problem for Access 2007. My questions are:
1. What if users upgrade to Office 2010? Do I have to change the code?
2. What if users do not use Outlook, instead, they use Windows Live
Mail? How do I change the code?

Thanks.

Song
0
Reply Song 6/2/2010 6:40:00 PM

You're best off using Late Binding so that you don't need to set a reference 
to a specific version.

Tony Toews has an introduction to the topic at 
http://www.granite.ab.ca/access/latebinding.htm

-- 
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)

"Song" <song.usa@gmail.com> wrote in message 
news:6042bd4b-6e45-47c7-9381-a0bfbfb8a397@e34g2000pra.googlegroups.com...
>I use reference to Microsoft outlook 12.0 Object Library. (Access
> 2007)
>
> Dim olApp As Outlook.Application
>    Dim objMail As Outlook.MailItem
>    Dim ctlBody As String
>
>    Set olApp = Outlook.Application
>    Set objMail = olApp.CreateItem(olMailItem)
>
>    Set objMail = Nothing
>    Set olApp = Nothing
>
> The above code has no problem for Access 2007. My questions are:
> 1. What if users upgrade to Office 2010? Do I have to change the code?
> 2. What if users do not use Outlook, instead, they use Windows Live
> Mail? How do I change the code?
>
> Thanks.
>
> Song 


0
Reply Douglas 6/2/2010 7:35:43 PM


1 Replies
410 Views

(page loaded in 0.057 seconds)

Similiar Articles:
















7/31/2012 4:40:32 AM


Reply: