Jump to content

How to open HTML file as Text File?


lobstersim
 Share

Recommended Posts

need help

how to open HTML file as text file?

open for editing its source.

I don't see the file pop up when using FileOpen()

thanks in advanced

$message = "Select the HTML file you want to edit"
$filePath = FileOpenDialog($message, "", "HTML Files(*.htm;*.html)")

If @error Then
    Exit
Else
    $file = FileOpen($filePath, 1)
EndIf
Link to comment
Share on other sites

need help

how to open HTML file as text file?

open for editing its source.

I don't see the file pop up when using FileOpen()

thanks in advanced

$message = "Select the HTML file you want to edit"
$filePath = FileOpenDialog($message, "", "HTML Files(*.htm;*.html)")

If @error Then
    Exit
Else
    $file = FileOpen($filePath, 1)
EndIf
Run("notepad.exe mypage.html")
Link to comment
Share on other sites

need help

how to open HTML file as text file?

open for editing its source.

I don't see the file pop up when using FileOpen()

you won't see a popup using fileopen() - you need to open the file for reading first, put the contents

in a variable, close the filehandle, make your edits, then write the file back out..

ie

;get filehandle for reading in file
$fh = FileOpen($filename,0)
;get contents of file
$contents = FileRead($fh,FileGetSize($filename))

fileclose($fh)
;do stuff to $contents
;write out new file

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...