Results 1 to 6 of 6

Thread: Transfer text into forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    8

    Transfer text into forms

    I have text in my file (.txt/.doc/.xls) with three columns of data, namely Sender,Subject and Message.
    I also have a form on my application with these same fields. I do not wish to type these data from my file into the form everytime. My application is macro enabled and has been desgined with VB. I want to know whether i could transfer these data from text file onto the resp. fields in the form with a single click of a button.

  2. #2
    New Member
    Join Date
    Nov 2003
    Location
    Montreal, Quebec
    Posts
    14
    Dim FileNo As Integer

    ' Associate a number with file
    FileNo=FreeFile

    'Open file "path&filename" enter the complete path of you file
    'For input and also be for output or for append.. but if you want to use the fields in your text file in your program you should use for input
    Open path&filename For Input As #FileNo

    'Loop till end of file
    Do Until EOF(LoadFile)
    'Input fields in text file into variables
    Input #LoadFile, Field1, Field2, Field3, Field4
    'if you need to save data for future use in program should probably use arrays if not can write additional statement in loop to display data
    Loop

    Text file must be delimited with commas... not comma at the end of the record. (i think its possible to delimite with quote(" ") but i haven't tried it yet. so i dont know if it works the same."
    Also in my program i use a txt file. I'm not sure if it will for on doc file and as for xls files i think you have to create and open connection to it. Then read in the file

    Sorry cant help more than that.. I'm new at this...

    Steffy

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    8

    Not so sure

    Thanks fo the reply, my application is macro enabled but i can only record macros. i cannot write VB code in it. so do i write this code in my excel sheet or on the application??

  4. #4
    New Member
    Join Date
    Nov 2003
    Location
    Montreal, Quebec
    Posts
    14
    I think you would write in your application... like if you wanna be able to transfer data from txt, doc and xls files.. into access you should create your macro in access... i hope that answers your questions cuz i didn't really understand what u wanted to know..

    steffy

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    8

    Xplanation

    I have an application in place which is used to record all faults. Some faults i get in through my email. What i do now is copy n paste each fault from my mail to the Appln system.

    What i need to do is transfer the from,subject and message field from each mail into the fields in my appln system with a single clik rather than copying n pasting.

    So far i have designed a macro in my outlook to transfer these fields from my mail into a text file with a single click.Now i need to transfer these frm my text file into the screen of the system with a single click, so that i dunt waste time going in and out of my inbox. Basically i want these text to just appear on the screen of my appln, with a single clik so that i click submit to log these text into my database thro my system.

  6. #6
    Banned
    Join Date
    Jul 2003
    Location
    New delhi
    Posts
    143
    hi

    can you send me the coding on my mail.i solve your problem
    i done before this
    biswajit dsa

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