visual basic + excel - sending emails to mulitple address stored in cells
Posted on 2003-10-22
once again more problems sending emails using visual basic (though a different program this time)
the guitarist in my band wants an easy to use mailing list. now there are plently of eaier options for doing this.. but i decided to try writing one using VB and Excel, just to see if i could really...
... i cant! or at least, im having trouble, hense the reason im here!
basically email addresses are stored in the individual cells of a column (range("a1") downwards)
at the moment, im using this code, kindly suggest by Bruintje in one of my previous questions to send the emails:
Dim iOutlook As Object
Dim myApp As Object
Set iOutlook = CreateObject("Outlook.Application")
Set myApp = iOutlook.CreateItem(0)
myApp.To = (blank)
myApp.Subject = "My Subject"
'myApp.Attachments.Add "C:\file.txt" '<-uncomment to attach a file
myApp.Body = "ello"
Set myApp = Nothing
Set iOutlook = Nothing
however, i want to know if it is possible to have the email sent to all the addresses stored in the column. i can do the address in the first cell of the column:
yApp.To = range("a1").value
but i havnt got a clue how to go about getting other email address into the "yApp.To" section.
is it possible? can the experts understand my crude explanation of my problem? will toast ever fall butter side up? only time will tell :)