A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Send email using spreadsheet



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old March 13th 09, 01:10 AM posted to microsoft.public.outlook.program_vba
atwork
external usenet poster
 
Posts: 4
Default Send email using spreadsheet

Hello,
I am trying to send an email from a spread sheet. Below is what i have done
so far but what I want to do is select the values in A1 (A1 is the email
address) and send the email then select the value in A2 (A2 is the next email
address) and send the email and so on but i have to stop after sending 200
emails even though i have about 3000 in the excel spread sheet. The cc
address and bcc address will be the same every time.
Sub SENDMAIL()
Dim olApp As Object
Dim olNs As Object
Dim olMail As Object
Dim Email_Address
Dim ExcApp As Object
Dim Excval As String
Set ExcApp = Application.CreateObject("excel.application")
Set ExcWb = ExcApp.Workbooks.Open("C:\users\XXX\mailing\send.x ls")
Excval = ExcWb.sheets("sheet1").Range("A1").Value
On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
Set olNs = olApp.GetNamespace("MAPI")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = Excval
.CC = "
'.BCC = "
.Subject = "We test and test"
.Body = "another test two"
.Attachments.Add "c:\users\XXX\Mailing\test.txt"
.Send
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check boxes in spreadsheet not lined-up when sent in email bmnjna2019 Outlook - Using Forms 1 October 29th 08 01:43 PM
need to send e-mail to addresses listed in spreadsheet cinnie Outlook - Using Contacts 1 August 14th 07 09:04 PM
Using email addresses from an Excel spreadsheet? Jan Outlook Express 3 October 4th 06 01:37 PM
Sending email from source Excel spreadsheet Richard Edwards Outlook - General Queries 1 August 9th 06 07:15 PM
How can I send a spreadsheet with email? Dr.Jon Outlook - Installation 4 June 29th 06 12:09 AM


All times are GMT +1. The time now is 02:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.