OK, I have a direcotry of documents, that list like this
600_20101122.csv
"Dim ctr,arrDocList, i
ctr = 0
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("\\Directory\FileList.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arrDocList = Split(strNextLine , "_")
For Each i In arrDocList
Set objMessage = CreateObject("CDO.Mesessage") objMessage.Configuration.Fields.Item (" = 2
objMessage.Configuration.Fields.Item (" = "mail.whatever.org"
objMessage.Configuration.Fields.Item (" = 25
objMessage.Subject = "Email Motification For Late Charges"
objMessage.From = "whomever@wheverever.org"
objMessage.To = & arrDocList (0) &"@whereever.org"
objMessage.TextBody = "Message"
objMessage.AddAttachment "\\directory\" & arrDocList(0) & "_" & LogStamp() &".csv"
objMessage.Configuration.Fields.Update
objMessage.Send
Next
Loop"
I need to read a directory, where the 111_20101122.csv, and other similiar files exist. Attach these files one by one to e-mails and use the first part of the document name to reference the e-mail address. Exp. 111 is Whomever@whereever.org 222 is misseswhatever@wherever.org.
any help would be appreciated.
600_20101122.csv
"Dim ctr,arrDocList, i
ctr = 0
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("\\Directory\FileList.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arrDocList = Split(strNextLine , "_")
For Each i In arrDocList
Set objMessage = CreateObject("CDO.Mesessage") objMessage.Configuration.Fields.Item (" = 2
objMessage.Configuration.Fields.Item (" = "mail.whatever.org"
objMessage.Configuration.Fields.Item (" = 25
objMessage.Subject = "Email Motification For Late Charges"
objMessage.From = "whomever@wheverever.org"
objMessage.To = & arrDocList (0) &"@whereever.org"
objMessage.TextBody = "Message"
objMessage.AddAttachment "\\directory\" & arrDocList(0) & "_" & LogStamp() &".csv"
objMessage.Configuration.Fields.Update
objMessage.Send
Next
Loop"
I need to read a directory, where the 111_20101122.csv, and other similiar files exist. Attach these files one by one to e-mails and use the first part of the document name to reference the e-mail address. Exp. 111 is Whomever@whereever.org 222 is misseswhatever@wherever.org.
any help would be appreciated.