Linking email address in a Form to automatically start Outlook

Tetley123

New member
Local time
Today, 23:46
Joined
Sep 24, 2007
Messages
1
Hi, what I'd like to be able to do is this... When someone clicks on an email address in a form, Outlook automatically opens with the email address in the 'To' box. Does anyone know how I would do this please?
 
I store the emails as plain text then a button with Email with an On Click:

Code:
Function Clients_Email()

Dim objOL As Outlook.Application
Dim objOLMsg As Outlook.MailItem
Dim objOLRecip As Outlook.Recipient
Dim MyObject As Object
    Set MyObject = CodeContextObject
    Set objOL = CreateObject("Outlook.Application")
    Set objOLMsg = objOL.CreateItem(olMailItem)

    If Not IsNull(MyObject![Client Email]) Then
        With objOLMsg
            Set objOLRecip = .Recipients.Add(MyObject![Client Email])
            objOLRecip.Type = olto
            .Display
        End With
    End If

End Function

Simon
 
Automatic Emailing from Access to Outlook

I too have used this code with success. However I am now trying to allow for the addition of using the CC and BCC fields.

I understand the syntax for creating the objects for both of these fields, and can run the code successfully.

However I cannot the get the 1st recipient, and the CC recipient and the BCC recipient to all appear on the same email. A new email message is created each time, entering the required address in the right field.

How do I get them to all enter on the same email?

I am using Access97

Many thanx
 
Where are the cc / bcc email addresses coming from?

Simon
 
Email

Essentially I have the following structure in the database

1) main form - holds company name etc
2) subform for each site address for each company
3) subform on 2) for each contact name at that site.

subform 3) is displayed as a continuous form, and holds a field called "EmailAddress".

I have used the code previously quoted on an event procedure of a button, to send emails direct from the database, works great.

I am now looking to be able to add email addresses from the subform as CC and BCC, or add the other addresses as multiple address in one of the fields, eg send, CC, BCC

The user needs the flexability to be able to create the email header from addresess held in the [EmailAddress] field on the form, eg an email may have one address in send and one in CC, or two addresses in send and 1 in BCC etc

My initial thoughts are an intermediate stage which assembles the header before sending to the emailing procedure????

Thanx in advance
 
search for "docmd.sendobject" this has a lot of options and can send using cc etc. a lazy way of doing it without access would be to setup outlook with some message rules to forward to whoever you want - leave message on server etc etc and can run every 1min so there is no user action required..
 
Hi

Thanks for the response, struggling with something else at the moment, but will try this out.

Thanx
 

Users who are viewing this thread

Back
Top Bottom