lobstersim Posted September 21, 2005 Share Posted September 21, 2005 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 More sharing options...
seandisanti Posted September 21, 2005 Share Posted September 21, 2005 need helphow 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) EndIfRun("notepad.exe mypage.html") Link to comment Share on other sites More sharing options...
flyingboz Posted September 21, 2005 Share Posted September 21, 2005 need helphow 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 contentsin 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 More sharing options...
lobstersim Posted September 22, 2005 Author Share Posted September 22, 2005 thanks flyingboz & cameronsdad for your replies. really appreciate it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now