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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jammydodger2
    New Member
    • Oct 2009
    • 4

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

    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.Connectio n
    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_C lick

    DoCmd.SendObjec t _
    , _
    , _
    , _
    , _
    , _
    ("" & strEmail), _
    , _
    , _
    True

    Exit_Command12_ Click:
    Exit Sub

    Err_Command12_C lick:
    MsgBox Err.Description

    Resume Exit_Command12_ Click

    End Sub



    Thanks for your help
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    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.Connectio n
    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_C lick

    DoCmd.SendObjec t _
    , _
    , _
    , _
    , _
    , _
    ("" & strEmail), _
    , _
    , _
    True

    Exit_Command12_ Click:
    Exit Sub

    Err_Command12_C lick:
    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

    Code:
    Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Code:
    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)

    Comment

    • jammydodger2
      New Member
      • Oct 2009
      • 4

      #3
      Thank you for your help

      Comment

      Working...