PC Review


Reply
Thread Tools Rate Thread

Access 2003 automation Outlook

 
 
=?Utf-8?B?Q2Vhc2FyaW5h?=
Guest
Posts: n/a
 
      7th Aug 2007
I´m trying to send messages with Outlook from Access 2003. This code works
just fine on Access 2000, but with 2003 it seems to work ONE TIME. Then I
have to restart the computer to make it work ONE TIME again...
Why? Would love to have some tips...
I have tried to add "outApp.quit" with the same result.

Function TestMail()

Dim outApp As Outlook.Application
Dim outMsg As MailItem
Dim Cancel As Boolean

Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
.To = "(E-Mail Removed)"
.Subject = "Test av mailfunktion"
.Body = "Hej Peter!" & vbCrLf & "Jag testar och leker."
.Attachments.Add "C:\bilder\banner.jpg"
.Send
End With

Set outApp = Nothing
Set outMsg = Nothing

End Function
 
Reply With Quote
 
 
 
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      7th Aug 2007
Probably and Outlook setting. I've used code similar to that to send
hundreds of emails. One of the things I've done though is to use Redemption
to destroy the security messages:

http://www.dimastr.com/redemption/
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Ceasarina" <(E-Mail Removed)> wrote in message
news:734EFE2F-0341-4CD6-A8B5-(E-Mail Removed)...
> I´m trying to send messages with Outlook from Access 2003. This code works
> just fine on Access 2000, but with 2003 it seems to work ONE TIME. Then I
> have to restart the computer to make it work ONE TIME again...
> Why? Would love to have some tips...
> I have tried to add "outApp.quit" with the same result.
>
> Function TestMail()
>
> Dim outApp As Outlook.Application
> Dim outMsg As MailItem
> Dim Cancel As Boolean
>
> Set outApp = CreateObject("Outlook.Application")
> Set outMsg = outApp.CreateItem(olMailItem)
> With outMsg
> .To = "(E-Mail Removed)"
> .Subject = "Test av mailfunktion"
> .Body = "Hej Peter!" & vbCrLf & "Jag testar och leker."
> .Attachments.Add "C:\bilder\banner.jpg"
> .Send
> End With
>
> Set outApp = Nothing
> Set outMsg = Nothing
>
> End Function



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2003 Automation with Microsoft Outlook 2003 Michael JD Hine Microsoft Access 1 10th Dec 2007 01:53 PM
Using Automation in Access 2003 to Work with Outlook 2003 =?Utf-8?B?RnJhbmNpc3Q=?= Microsoft Outlook Interoperability 2 21st Jun 2005 09:46 AM
vba automation to word 2003 (controlling application Access 2003/2000); sample code? Philip Leduc Microsoft Access 0 23rd Dec 2004 08:06 PM
microsoft access automation to outlook version 2003 compared with 2000 Philip Leduc Microsoft Outlook 1 16th Feb 2004 01:41 PM
stopping prompts using automation from access 2003 to outlook 2003 able chapkins Microsoft Outlook VBA Programming 2 15th Jan 2004 01:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:36 PM.