Results 1 to 5 of 5

Thread: text file usage

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    16

    Question

    ok if you had a text file that held a url how would you use it in


    lReturn = ShellExecute(hwnd, "open", "URL GOES HERE", vbNull, vbNull, SW_SHOWNORMAL)

    ^all one line^

    thanks

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    Your really pushing it...

    Usually you couldn't do this but there is ONE possibility but it is a bit sketchy and relies on a few things...

    Code:
    lReturn = ShellExecute(hwnd,"open","echo txtfile.txt",vbNull,vbNull, SW_SHOWNORMAL)
    What this does is uses the "echo" DOS command to display the contents of the text file but I suspect ANYTHING you place in the "URL GOES HERE" would be taken literally as a string instead of a DOS command which means you physically CANNOT do the whole thing in one line.

    Instead you do this :

    Code:
    Dim sURL as String
    
    Open "txtfile.txt" for input as #1
    Line Input #1, sURL
    Close(1)
    
    lReturn = ShellExecute(hwnd,"open",sURL,vbNull,vbNull, SW_SHOWNORMAL)
    Its not one line, its 4... but it works ;-)

  3. #3
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    What am I missing

    Gen-X:
    I tried your snippet and could not make it work. IE4 opens but the url is not posted. I am on NT4 and as I said, IE4.72...

    Regards
    Paul Lewis

  4. #4
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    You asked for a code that could put the URL in the place you wanted... and thats what I did...

    If it doesn't work then that means something else in your statement is wrong.

    Good luck

  5. #5
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Auckland, NZ
    Posts
    411

    Thanks

    I was only an interested bystander. Microslip originally asked the question, and while browsing I thought I could use that idea myself so I tried it.

    You're probably right that something else in my machines settings are askew so hopefully it works for Microslip and others.

    I'll revisit it at another time as I'd like to make a nice little "html link" control which subclasses an ordinary label, but interprets (and highlights and tracks) http:// references, launching them if pressed.

    All I want that for is my Help|About screen

    It was a good reply you made to Microslip anyhow Gen-X so don't think I was being unkind by saying it didn't work for me

    Catch you later

    Paul Lewis

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