Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,642 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,095 people online right now. Registration is fast and FREE... Join Now!




MS Access & AOL

 
Reply to this topicStart new topic

MS Access & AOL, Use MS Access to send e-mail via AOL

geoffslea
post 5 Sep, 2008 - 01:50 AM
Post #1


New D.I.C Head

*
Joined: 4 Sep, 2008
Posts: 2

I'm trying to use MS Access to email via AOL
I don't want to use Outlook, and AOL help team are a fat lot of good!!
I've left a lot of commented code in as i have tried various ways of doing this and i keep old code till i'm finished then tidy it up.
No laughing please I'm doing my best here but am stumped for the moment.

Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click

Dim stAppName As String
Dim Recipients As String
Dim szSubject As String
Dim szMsgFile As String
Dim Stremail As String

Recipients = email 'field where email address is taken
szMsgFile = "This is a test message"
szSubject = "Message from Mercurius Dance Company"
stAppName = "C:\Program Files\AOL 9.0a\aol.exe"

' Call Shell(stAppName, 1) >>>>either of these work
Call Shell(stAppName, vbMaximizedFocus) >>>>either of these work
With AOLClientCommunications 'urgh this is where it goes wrong!
.MailCompose
.szSubject
.szMsgFile
.Recipients
' .CCRecipients >>>>> i'm not using this
' .BCCRecipients >>>>> i'm not using this
' .Attachments >>>>>> i'm not using this
.edit
End With

' Call Shell("C:\Program Files\AOL 9.0a\aol.exe", "MailCompose", 1)
' Call Shell("C:\Program Files\AOL 9.0a\aol.exe" "MailCompose" "szSubject" "szMsgFile" "Recipients"","",""),1")

'Shell ("c:\myapplication.exe" "argument1" "argument2")
' stAppName = "C:\Program Files\AOL 9.0a\aol.exe" "MailCompose(szSubject, szMsgFile, Recipients)"
'Stremail = "MailCompose stSubject, stMessageText, sttoEmail"
' MailCompose(szSubject As String, szMsgFile As String, Recipients, CCRecipients, BCCRecipients, Attachments)

Exit_cmdEmail_Click:
Exit Sub

Err_cmdEmail_Click:
MsgBox Err.Description
Resume Exit_cmdEmail_Click

End Sub
User is offlineProfile CardPM

Go to the top of the page

dineeshd
post 5 Sep, 2008 - 02:05 AM
Post #2


D.I.C Addict

Group Icon
Joined: 30 Jun, 2008
Posts: 560



Thanked 16 times

Dream Kudos: 575
My Contributions


So what is your issue with the code? Is it not working as you want? Is it throwing some error, if then what error its throwing? You need to explain.... rolleyes.gif
User is offlineProfile CardPM

Go to the top of the page

geoffslea
post 5 Sep, 2008 - 05:23 AM
Post #3


New D.I.C Head

*
Joined: 4 Sep, 2008
Posts: 2

oops sorry
it opens the AOL mail program ok, but Access throws up the error

object required


i understand how to do this if it was outlook being used as the mail program
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 04:37AM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month