Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currently I have an email system to

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Currently I have an email system to send a word document to me once it has been processed, but I have a table in my database of contacts (inc. Name, Email Address), I'd like to be able to email all of these contacts, the code I have should work with a loop but i'm not sure what sort of loop to use, or if there is a more efficient way please let me know, the code I currently use is...

Dim myOlApp, myItem, myAttachments
Dim fs As Object

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set myAttachments = myItem.Attachments
myItem.Body = "Body Content"
myItem.Subject = "Subject"
myItem.To = "email address"
myAttachments.Add "C:\WINDOWS\Desktop\file.doc", olByValue, 200, "FileName"
myItem.Send

I have looked through the email help but I can't seem to find what should be a simple answer to my question, if i'm wrong please correct me :)

Any ideas? Thanks For any help,


Sam
 
Hello there I've figured this problem out if anyone wants to know leave a message here n I'll post it, seeya later.


Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top