Results 1 to 3 of 3

Thread: search file ..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Question

    Greetings,

    Does anyone know how to acomplish this task ?
    I have tried for my self the last couple of days but im always getting stuck..

    here is what i want to do.

    open file1.
    make a temporary file2 that got the same content as file1.
    close file1.
    search temp file2 for strings like $Name, $Lastname and so on..
    replace the $ strings in file2 with strings from text boxses in a program.
    print the temporary file2.
    when printing is complete delete temp file2.

    im having most problems with the find and replace $ strings and the printing..
    Anything will help at this point.

    Thanks in advance


    -Lumin

  2. #2
    Guest
    If you're using vb6 try this:

    Code:
        Dim MyFirstName As String
        Dim MyLastName As String
        Dim TheString As String
        
        TheString = "Hi, my name is $Firstname $Lastname"
        
        MyFirstName = "Slim"
        MyLastName = "Shady"
        
        TheString = Replace(TheString, "$Firstname", MyFirstName, , , vbTextCompare)
        TheString = Replace(TheString, "$Lastname", MyLastName, , , vbTextCompare)
    
        MsgBox TheString
    But this only works on VB6 (and higher )

    Enjoy!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Bergen, Norway
    Posts
    143

    Lightbulb

    Thanks..

    I'm using VB 6 so this was indeed helping me out..
    im exploring the functions right now


    -Lumin

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