• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

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
----------------------------------------------------------------------------
0
Richard Comito
Asked:
Richard Comito
  • 2
1 Solution
 
toddhdCommented:
I believe it's OpenMode.Append
0
 
toddhdCommented:
FileOpen(2, "c:\EmailFile.txt", OpenMode.Append, OpenAccess.Write)
0
 
Richard ComitoDirector of ITAuthor Commented:
toddhd,  Thanks for being specific.  I got it this time.  :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now