Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 5th, 2008, 05:08 AM
Registered User
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending Email Macro

Currently at work, I need to send a .jpg file that has to be displayed on the email body and this has got to be sent to 2000 emails addresses which are saved in an excel file.

Is there a macro out there make life easier?

At the moment i only have got this to work on:

Sub sendemail()
Dim olApp As Outlook.Application, olMail As Outlook.MailItem
Dim Rng As Range
    Set olApp = New Outlook.Application
    Set olMail = olApp.CreateItem(olMailItem)
    olMail.To = ActiveCell.Value
    olMail.Subject = "Job Positions Available in the month of June"
    olMail.Body = "Insert Body"
    olMail.Display
End Sub


 
Old June 5th, 2008, 08:02 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Please have a look at the following link

http://vbadud.blogspot.com/2007/04/v...-vba-mail.html

Cheers
Shasur

http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)
 
Old June 5th, 2008, 11:40 PM
Registered User
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Managed to get it done but i need to insert a jpg file in the body of the email and display it...

is there a way to do it?

at the same time is it possible to forward an existing email and use these codes?

Quote:
quote:
Sub sendemail()

Dim olApp As Outlook.Application, olMail As Outlook.MailItem
Dim myRow As Range

For Each myRow In Range("A1:A2") 'Change the Values to the last number of the row

    Set olApp = New Outlook.Application

    Set olMail = olApp.CreateItem(olMailItem)

    olMail.To = myRow.Value

    olMail.Subject = "Job Positions Available in the month of June" 'place your subject here

    olMail.HTMLBody = "" 'place your message here

    olMail.Attachments.Add (".jpg")

    olMail.Display

Next myRow

End Sub
 
Old June 18th, 2008, 07:58 AM
Registered User
 
Join Date: Jun 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can anyone help me?

 
Old June 27th, 2008, 10:49 AM
JP JP is offline
Authorized User
 
Join Date: Apr 2008
Posts: 57
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Did you read this?

http://www.outlookcode.com/d/code/htmlimg.htm






Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to send an email with an attachment in it samputha Excel VBA 2 August 13th, 2009 09:12 PM
Excel Macro - Send Email and Attachments robmill101 Excel VBA 1 October 21st, 2008 08:10 AM
Need macro to send email via default mail program chutchinson Excel VBA 0 September 27th, 2007 09:28 PM
Sending Email soccers_guy10 Pro VB 6 3 February 11th, 2004 10:41 AM
email an excelsheet using a macro behind a button Haroldd Excel VBA 2 January 8th, 2004 04:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.