I had a question yesterday regarding sending to a list of email addresses
that you have in Excel and you're sending one the same attachment to each
one so this the example that we're using is you'd send out your catalog and so
here we have our email addresses the subject would be for every one would be
here's our new catalog and so now let's go look at the code and so this is
basically the same code as I used before so let's just go so I've got email from
Excel addresses a string subject is string messages string and it all
basically last rows integer attachment is string X as an integer okay so you're
doing a for loop so x equals two because we have headings on our first row
do-while sheet one cells X so though it where the address is me until it do it
until then it's empty and then you're gonna set outlook app create object
outlook application set and look might set Outlook mail item equals outlook
create item 0 set my attachment as Outlook mail item dot attachment and
this this is where you would put the path of your of where your catalog or
whatever file that you want to send everybody is and so once again how I go
there is I go and I bring up where the location is
and what I do is I click in the address bar and I copy it and then I bring it
back and then you just insert it into the path making sure that you put
quotation marks and a backslash at the end with the quotation marks that's all
very important he address equals the addresses that we have in column one the
file name it's going to be the same file each time on this one so
it's gonna be catalogue dot doc X and the attachment equals the path which
we've defined up here plus the file name Outlook mail item so the two is an email
address that we have on our excel sheet Outlook carbon-copy in the blank carbon
or the blind carbon copy or or a blank subject is what we have created in our
in our second column and then the body please find attached your statement so
please find your catalogue I should probably say in hearing attached and
best regards okay attachments add Outlook mail at him
display Outlook mail item Sindh and then we go to the last row and then we loop
outlook absolute equals nothing and send Outlook mail equals nothing and then end
sub so let's test this out so let we can just f8 through the whole thing so as
you can see it happily goes along
and it goes in it begins the loop once again okay so let's see what the output
is of this so here is the output what the email item looks like from our from
our little macro so that's how you send one item to a list of name or email
addresses that you have in Excel please subscribe