Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 10th, 2006, 09:05 PM
Mr T
Guest
 
Posts: n/a
Default Send Email from Access Using a custom Outlook Form

I know how to send email from Access and I know how to create a custom
form in Outlook. but.... How do I put the email info from Access into
the Outlook custom form ???

Dim MyDB As Database
Dim MyRS As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TheAddress As String

Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset("Select * from tblMailingList Where
responded <>-1")
MyRS.MoveFirst

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")


Do Until MyRS.EOF
' Create the e-mail message.

Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
TheAddress = MyRS![emailaddress]
If MyRS!responded <-1 Then


With objOutlookMsg
' Add the To recipients to the e-mail message.
Set objOutlookRecip = .Recipients.Add(TheAddress)
objOutlookRecip.Type = olTo



If TheAddress = "Joe.Blow@somewhere.com" Then

.Subject = "Only " & [daysleft] & " Days Left Till Your
Report Is Due !"
.Body = " John," & _
"You have " & [daysleft] & " days remaining to
submit the your updates!"
.Importance = olImportanceHigh


Else

' Set the Subject, the Body, and the Importance of the e-mail
message.
.Subject = "***MANDATORY RESPONSE REQUIRED***"



.Body = "BLAH BLAH BLAH BLAH" & _
"Thank you for help."
.Importance = olImportanceHigh 'High importance

'Resolve the name of each Recipient.
End If

For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
If Not objOutlookRecip.Resolve Then
objOutlookMsg.Display
End If
Next

.Display
'.Send
End With


End If
MyRS.MoveNext

Loop

Set objOutlookMsg = Nothing
Set objOutlook = Nothing


End Sub

Suggestions ???

  #2  
Old August 10th, 2006, 09:25 PM
pietlinden@hotmail.com
Guest
 
Posts: n/a
Default Re: Send Email from Access Using a custom Outlook Form


Mr T wrote:
Quote:
I know how to send email from Access and I know how to create a custom
form in Outlook. but.... How do I put the email info from Access into
the Outlook custom form ???
>
Suggestions ???
Sure. Check the Outlook NG. Essentially what you're saying is that
"this is an Outlook problem". It's not that I'm trying to put you off,
but the likelihood of finding someone who knows enough about Outlook
forms to help you in that NG is much higher than it is here.

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles