Connecting Tech Pros Worldwide Forums | Help | Site Map

Is it possible to open a new e-mail message in AOL istead of Outlook?

Newbie
 
Join Date: Oct 2009
Posts: 4
#1: 3 Weeks Ago
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

ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,219
#2: 3 Weeks Ago

re: Is it possible to open a new e-mail message in AOL istead of Outlook?


Quote:

Originally Posted by jammydodger2 View Post

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:
  1. Open America Online/Execute aol.exe
  2. Signs On (with AutoFill User name & Password)
  3. Opens a New Mail Window
  4. Fills in a Recipient (Send to) Name
  5. Fills in a Subject Name
Expand|Select|Wrap|Line Numbers
  1. Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Expand|Select|Wrap|Line Numbers
  1. Dim varRet As Variant
  2.  
  3. 'Launch AOL
  4. varRet = Shell("C:\Program Files\America Online 9.0\aol.exe", vbMaximizedFocus)
  5.  
  6. 'Wait 3 seconds, then Send the ENTER Key (Sign On)
  7. Sleep (3000)
  8. SendKeys "{ENTER}", True
  9.  
  10. 'Wait 10 seconds, then Open a New Mail Window
  11. Sleep (10000)
  12. SendKeys "%M", True     'ALT+M
  13.  
  14. 'Wait 2 seconds, Navigate 1 Down on the Mail Menu (Write Mail, press ENTER
  15. Sleep (2000)
  16. SendKeys "{DOWN 1}", True
  17. SendKeys "{ENTER}", True
  18.  
  19. 'Wait 3 seconds, enter String in the send to Field
  20. Sleep (3000)
  21. SendKeys "FredFlintstone@prehistoric.com"
  22.  
  23. 'Wait 1 second, then hit the TAB Key twice to get to the Subject Field,
  24. 'enter Subject
  25. Sleep (1000)
  26. SendKeys "{TAB 2}", True
  27. 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)
Newbie
 
Join Date: Oct 2009
Posts: 4
#3: 2 Weeks Ago

re: Is it possible to open a new e-mail message in AOL istead of Outlook?


Thank you for your help
Reply