![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Here is my code, however it stops (at [pomt ***) on the second pass and only
send to on email address. Public Sub EmailNewCustomers() Dim endFile As Integer Dim emailAddress As String Dim myMail As Outlook.MailItem Set myMail = Application.CreateItem(olMailItem) Dim cusEmailAddress As String Open "C:\Documents and Settings\Administrator\My Documents\TESTFILE1.txt" For Input As #1 Do While Not EOF(1) ' Loop until end of file. Line Input #1, cusEmailAddress endFile = 1 If emailAddress = "EOF" Then endFile = 0 Do While endFile = 1 endFile = endFile - 1 With myMail .To = cusEmailAddress .Subject = "New! Weight Loss and Natural Lifestyle Book" .Body = "New! Weight Loss and Natural Lifestyle Book." .Attachments.Add "C:\Documents and Settings\Administrator\My Documents\1-sync\a-before and after\before and after.pdf", olByValue, 1 End With myMail.Send Debug.Print cusEmailAddress ' Print to the Immediate window. Loop Loop Close #1 ' Close file. Const cstrProcedure = "emailer_test" On Error GoTo HandleError HandleExit: Exit Sub HandleError: ErrorHandle Err, Erl(), cstrModule & "." & cstrProcedure Resume HandleExit End Sub |
Ads |
#2
|
|||
|
|||
![]()
I have no idea what at [pomt *** is, nothing is indicated. However your
inner loop is setting endFile = 1, then decrementing it, then on the next pass the loop will fail the endFile test. What is endFile there for anyway? It seems to serve no useful purpose. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Tommy Geek" wrote in message ... Here is my code, however it stops (at [pomt ***) on the second pass and only send to on email address. Public Sub EmailNewCustomers() Dim endFile As Integer Dim emailAddress As String Dim myMail As Outlook.MailItem Set myMail = Application.CreateItem(olMailItem) Dim cusEmailAddress As String Open "C:\Documents and Settings\Administrator\My Documents\TESTFILE1.txt" For Input As #1 Do While Not EOF(1) ' Loop until end of file. Line Input #1, cusEmailAddress endFile = 1 If emailAddress = "EOF" Then endFile = 0 Do While endFile = 1 endFile = endFile - 1 With myMail .To = cusEmailAddress .Subject = "New! Weight Loss and Natural Lifestyle Book" .Body = "New! Weight Loss and Natural Lifestyle Book." .Attachments.Add "C:\Documents and Settings\Administrator\My Documents\1-sync\a-before and after\before and after.pdf", olByValue, 1 End With myMail.Send Debug.Print cusEmailAddress ' Print to the Immediate window. Loop Loop Close #1 ' Close file. Const cstrProcedure = "emailer_test" On Error GoTo HandleError HandleExit: Exit Sub HandleError: ErrorHandle Err, Erl(), cstrModule & "." & cstrProcedure Resume HandleExit End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to send email to several contacts without making a dist. list | Oraclewiz | Outlook - Using Contacts | 3 | November 9th 06 10:10 PM |
can i send one email to mailing list but with diff. attahments? | MadhavLadva | Outlook - Using Contacts | 1 | July 25th 06 01:07 PM |
Extract email addresses from Distribution LIst in Global Address List | tthomas | Outlook and VBA | 2 | June 22nd 06 12:02 AM |
Why does my distribution list send to only one email within the li | perfect gent | Outlook - General Queries | 1 | May 17th 06 02:44 PM |
How to send copy of Distribution list (names, email addr.) to Bd. | Meg | Outlook - Using Contacts | 19 | April 26th 06 02:27 PM |