Link to home
Start Free TrialLog in
Avatar of Richard Comito
Richard ComitoFlag for United States of America

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("fldEmailAddress").Value)
                            MessageBox.Show(c.InnerException.InnerException.ToString())
                        End Try
----------------------------------------------------------------------------
Avatar of toddhd
toddhd

I believe it's OpenMode.Append
ASKER CERTIFIED SOLUTION
Avatar of toddhd
toddhd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Comito

ASKER

toddhd,  Thanks for being specific.  I got it this time.  :)