Results 1 to 3 of 3

Thread: [RESOLVED] copy text from 1 file into another

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2004
    Posts
    59

    [RESOLVED] copy text from 1 file into another

    hi

    using vba in word, i was able to read the text from 1 file and insert it into the document which was reading the file. i have forgotten how to do this.

    does anyone know?

    thanks
    Last edited by narmi2; Jul 22nd, 2005 at 11:35 AM. Reason: Resolved

  2. #2
    New Member
    Join Date
    Jul 2005
    Posts
    15

    Re: copy text from 1 file into another

    you can read straight from a text file using:

    VB Code:
    1. Dim myFile as string, myLine as string
    2. myFile = "C:\ThisFile.txt"
    3.  
    4. open myFile for Input as #1
    5.  
    6. do while not eof(1)
    7. Line input #1, myLine
    8. 'Use this line elsewhere
    9. msgbox myLine
    10. loop
    11.  
    12. close #1

    Hope this helps?
    sugarflux

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2004
    Posts
    59

    Re: copy text from 1 file into another

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width