Richard Comito
asked on
Trying to write and append a text file with OpenFile.
I am tring to capture a list of bad email addresses that cause errors in my program. I want to be able to open the file and write and append the file if there is information in the file already. I would like to add each email address to it's own line. Below is the code I am working on.
Thanks.
-------------------------- ---------- ---------- ---------- ---------- ---------
Try
mailServer.Send(newMail)
Catch c As Exception
FileOpen(2, "c:\EmailFile.txt", OpenMode.Input, OpenAccess.Write)
Write(2, rsEmailList("fldEmailAddre ss").Value )
MessageBox.Show(c.InnerExc eption.Inn erExceptio n.ToString ())
End Try
-------------------------- ---------- ---------- ---------- ---------- ----------
Thanks.
--------------------------
Try
mailServer.Send(newMail)
Catch c As Exception
FileOpen(2, "c:\EmailFile.txt", OpenMode.Input, OpenAccess.Write)
Write(2, rsEmailList("fldEmailAddre
MessageBox.Show(c.InnerExc
End Try
--------------------------
I believe it's OpenMode.Append
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
toddhd, Thanks for being specific. I got it this time. :)