Thanks
Dawn,
I will
give it a try.
Andrew
-----Original Message-----I have used this code from Tom. Perhaps it will help you.
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Crosier, Dawn
Sent: Tuesday, November 29, 2005 1:05 PM
To: [email protected]
Subject: RE: [AccessDevelopers] Code to open Outlook and populate Subject and recipients
'***** code start *****'
'Code by: Tom Oakes
'Personal PC Consultants, Inc.
'[EMAIL PROTECTED]
'503.230.0911 (O)
'402.968.6946 (C)
'734.264.0911 (F)
Public Function SendCDOMail(strTo As String, strSubject As String,
strBody As String, strAttach As String, blnHTML As Boolean) As Boolean
On Error GoTo Failure
Dim objMessage As CDO.Message
Dim objConfig As CDO.Configuration
Dim objFields As Variant
Const cboSendUsingPort As Integer = 2
Set objConfig = New CDO.Configuration
Set objMessage = New CDO.Message
Set objFields = objConfig.Fields
With objFields
Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
. cdoSendUsingPort
Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
. GetSMTPServer()'<-- valid SMTP server
Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontime
. out") = 10
Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =
. 25
.Update
End With
With objMessage
Set .Configuration = objConfig
TO = strTo
. From = GetNTUSER & "@" & GetMailDomain()'<-- automatically uses current
. user as "From"
.Subject = strSubject
If blnHTML = True Then
.HTMLBody = strBody
Else
.TextBody = strBody
End If
If strAttach <> "" Then .AddAttachment (strAttach)
.Send
End With
Set objMessage = Nothing
Set objFields = Nothing
Set objConfig = Nothing
SendCDOMail = True
EXITROUTINE:
Exit Function
Failure:
SendCDOMail = False
MsgBox Err & " " & Err.Description
Resume EXITROUTINE
End Function
'***** code end *****'
Dawn Crosier
Application Specialist
"Education Lasts a Lifetime"
This message was posted to a newsgroup. Please post replies and
questions to the group so that others can learn as well.
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of rock_jam
Sent: Monday, November 28, 2005 3:30 PM
To: [email protected]
Subject: [AccessDevelopers] Code to open Outlook and populate Subject
and recipients
Hello All,
I am new and hope you can help. I have a table with email contacts.
How do I open Outlook and populate the subject and recipients with the
emails in the table? I am using Access 2003.
Thanks,
Andrew
Please zip all files prior to uploading to Files section.
SPONSORED LINKS
Microsoft access developer Microsoft access help Microsoft access training Microsoft access training course Microsoft access programming Microsoft access tutorial
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
