Trying to write and append a text file with OpenFile.

Posted on 2004-11-04
Last Modified: 2010-04-24
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.


                        Catch c As Exception
                            FileOpen(2, "c:\EmailFile.txt", OpenMode.Input, OpenAccess.Write)
                            Write(2, rsEmailList("fldEmailAddress").Value)
                        End Try
Question by:GabicusC
    LVL 8

    Expert Comment

    I believe it's OpenMode.Append
    LVL 8

    Accepted Solution

    FileOpen(2, "c:\EmailFile.txt", OpenMode.Append, OpenAccess.Write)

    Author Comment

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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video discusses moving either the default database or any database to a new volume.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now