Results 1 to 2 of 2
  1. #1
    cg1465 is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    8

    Passing Email Address Into Outlook

    I'm having partial success with this script. However, I'd like to pass the email address in my record in my form to the "To" field in Outlook. I'm not having any luck using Forms![FirstUSA]![Email]. Everything else works great!

    Thanks in advance!



    Clint

    Dim objOutlk 'Outlook
    Dim objMail 'Email item
    Dim strMsg
    Const olMailItem = 0
    'Create a new message
    Set objOutlk = CreateObject("Outlook.Application")
    Set objMail = objOutlk.createitem(olMailItem)
    objMail.To = ("Forms![FirstUSA]![Email]")
    objMail.cc = "" 'Enter an address here to include a carbon copy; bcc is for blind carbon copy's
    'Set up Subject Line
    objMail.subject = "First USA Project Summary"
    'Add the body
    strMsg = "Hi "
    'To add an attachment, use:
    objMail.attachments.Add ("C:\FirstUSA\Prospects\" & Forms![FirstUSA]![Phone1] & ".doc")
    objMail.body = strMsg
    objMail.display 'Use this to display before sending, otherwise call objMail.Send to send without reviewing
    'Clean up
    Set objMail = Nothing
    Set objOutlk = Nothing

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    My favorite email answers site: http://www.granite.ab.ca/access/email.htm

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-01-2010, 08:43 PM
  2. Exporting Outlook email addresses
    By noidea in forum Import/Export Data
    Replies: 0
    Last Post: 08-01-2009, 01:48 PM
  3. Replies: 1
    Last Post: 05-01-2009, 07:33 AM
  4. Replies: 1
    Last Post: 03-09-2006, 01:50 PM
  5. Sending email via Outlook (and Exchange2003) from Access2003
    By Larry Elfenbein in forum Programming
    Replies: 0
    Last Post: 11-15-2005, 09:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums