A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Read email list send to each on list same formated in outlook 200.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 13th 06, 08:27 PM posted to microsoft.public.outlook.program_vba
Tommy Geek
external usenet poster
 
Posts: 1
Default Read email list send to each on list same formated in outlook 200.

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  
Old December 13th 06, 08:49 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Read email list send to each on list same formated in outlook 200.

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 11:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.