Quote:
Originally Posted by jammydodger2
Hello,
At the moment i am using the code below to open up a new email message with all my listed clients e-mail addresses in the bcc field. Unfortunatly instead of outlook i need to open up in AOL.
I'm guessing this may not be possible, as then it would have to open up a browser, login and then create a new message.
So does anyone know of a better way to go about this?
CODE
Private Sub Command12_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strEmail As String
Set cn = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM CustomerT WHERE Email Is Not Null", cn
With rs
Do While Not .EOF
strEmail = strEmail & .Fields("Email") & ";"
.MoveNext
Loop
.Close
End With
On Error GoTo Err_Command12_Click
DoCmd.SendObject _
, _
, _
, _
, _
, _
("" & strEmail), _
, _
, _
True
Exit_Command12_Click:
Exit Sub
Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub
Thanks for your help
AOL is a horse of a different color, but here is some partial code that you can have fun with in you spare time, and it is actually functional. The following code will:
- Open America Online/Execute aol.exe
- Signs On (with AutoFill User name & Password)
- Opens a New Mail Window
- Fills in a Recipient (Send to) Name
- Fills in a Subject Name
- Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
- Dim varRet As Variant
-
-
'Launch AOL
-
varRet = Shell("C:\Program Files\America Online 9.0\aol.exe", vbMaximizedFocus)
-
-
'Wait 3 seconds, then Send the ENTER Key (Sign On)
-
Sleep (3000)
-
SendKeys "{ENTER}", True
-
-
'Wait 10 seconds, then Open a New Mail Window
-
Sleep (10000)
-
SendKeys "%M", True 'ALT+M
-
-
'Wait 2 seconds, Navigate 1 Down on the Mail Menu (Write Mail, press ENTER
-
Sleep (2000)
-
SendKeys "{DOWN 1}", True
-
SendKeys "{ENTER}", True
-
-
'Wait 3 seconds, enter String in the send to Field
-
Sleep (3000)
-
SendKeys "FredFlintstone@prehistoric.com"
-
-
'Wait 1 second, then hit the TAB Key twice to get to the Subject Field,
-
'enter Subject
-
Sleep (1000)
-
SendKeys "{TAB 2}", True
-
SendKeys "<Subject Name Here>"
P.S. - You may have to play with the Delays (Sleep values) in order to make it work on your PC - these Values are in milliseconds)