Email to from Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have created a database for my company to use. I am looking for a code or
routine to help me on the following:
An email address is shown on the cell D12
I have written a code to change the cell contents from formula to email.
I would like a button to copy the email address and open outlook to create
an email to the specific address shown. I can do the rest but i am really
stuck on this one.
If outlook is open, it may need an error handler to stop a second instance
opening.

Summary:
i select my contact,
press a button,
outlook opens and the email address is in the "send to"

Regards,

Nigel
 
Hi,
There doesnt seem to be what i am looking for. it seems that everything on
the site will automatically send a sheet or a book. i only want to open
outlook to send my own email with my own subject etc. unless i am not seeing
something.

nige
 
Just modify the code so it doesn't send or add an attachment. The basic
code you need is there.
 
Here is the basic code

Sub SendEmail()
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object

Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True

Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = oMailItem.Recipients.Add(Range("D12").value)
oRecipient.Type = 1
oMailItem.Subject = "an email from me"
oMailItem.Body = "How are you"
oMailItem.Send

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top