|
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
|