PDA

View Full Version : Create Outlook email to send out



Nicolaf
03-23-2012, 08:21 AM
Hi,

I need a macro in Sheet1 that creates an email to send out, fills it with recipient and title and copies / pastes range C7:F13 (in Sheet1) onto it.

title is found in cell A1

How do i do that?

:dunno :doh: :think:

Nix

DannyBOHLEN
03-23-2012, 10:33 AM
try this:



Private Sub Label1_Click()
Dim App, Mail As Object
Application.ScreenUpdating = False
Set App = CreateObject("Outlook.Application")
Set Mail = App.CreateItem(0)
With Mail
.To = "xxxxxx"
.cc = "xxxxxxx"
.Subject = ActiveSheet.Cells(1, 1).Text
.body = ActiveSheet.Range("C7:F13").Value
.display
.ReadReceiptRequested = False
.Attachments.Add ActiveWorkbook.FullName
'.send = True
End With
Set App = Nothing
Set Mail = Nothing
End Sub

mancubus
03-23-2012, 10:53 AM
see:

http://www.rondebruin.nl/mail/folder2/mail4.htm

Nicolaf
03-23-2012, 11:01 AM
Hi,

I get error message: "Run-time error'-2147467259(80004005)'
Array lower bound must be zero"

When I go into Debug I see " .body = ActiveSheet.Range("C8:F13").Value " highlighted in yellow.

Have I done something wrong?

Thanks,
Nix

georgiboy
03-23-2012, 11:32 AM
See the website that Mancubus has recommended, I suggest you go with the HTML method, that's the one I like to use. This website is rich in relevant information.

Nicolaf
03-23-2012, 11:41 AM
Thanks!

:hi: