Jump to content

Recommended Posts

Posted

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
Posted

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")
Posted

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.

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
×
×
  • Create New...