A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

have to restart access after sending one email



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 6th 06, 04:46 PM posted to microsoft.public.outlook.program_vba
Tony Epton
external usenet poster
 
Posts: 4
Default have to restart access after sending one email

Using Access 2000, outlook express 6

Attempting to automate email for those people who have requested book
scans and scan is older than one month - email asks them to reconfirm
their request

The code below is intended to send multiple emails from highlighted
list box items.
The msgbox in the code successfully displays each attempt - but only
the very first attempt gets emailed, none following and no error
message.
I have to shut down access and restart the program before another
email will go out.

I have turned of "Warn me when other applications attempt to send
email as me" in outlook express


For Each varItm In lst.ItemsSelected
lngRequestId = lst.ItemData(varItm)
RetrieveTemplate Me.cmbEmailTemplate
Set rs = CurrentDb().OpenRecordset("BookRequests")
rs.FindFirst "RequestId = " & lngRequestId
If rs.NoMatch Then
MsgBox "Cannot find book request - cancelled"
Else
strTemplateHeading = Me.TemplateHeading
strTemplateBody = Me.TemplateBody

strTemplateHeading =
EmailSubstitution(strTemplateHeading, rs)
strTemplateBody = EmailSubstitution(strTemplateBody, rs)
strEmailTo = rs!EmailAddress
strEmailToCC = "
Me.TemplateHeading = strTemplateHeading
Me.TemplateBody = strTemplateBody
DoEvents

DoCmd.SendObject acSendNoObject, , , strEmailTo,
strEmailToCC, , strTemplateHeading, strTemplateBody, False
MsgBox rs!emailaddress
End If
rs.Close
Set rs = Nothing
Next varItm


Any help greatly appreciated
Tony Epton
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
access macros to automate e-mail sending in outlook Trader Alex Outlook and VBA 1 April 13th 06 09:21 PM
Autotext disappear after restart mick lim Outlook - General Queries 0 March 29th 06 09:49 AM
Sending Email With Outlook Or Even Web Access [email protected] Outlook - General Queries 1 March 22nd 06 04:11 PM
How do I access my personal contacts when sending a message? TLC1980 Outlook - Using Contacts 1 March 8th 06 06:08 PM
Hotmail no longer allows email access via Outlook Express for free email accounts? Christina Outlook Express 3 January 11th 06 04:49 AM


All times are GMT +1. The time now is 02:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.