ok useing the common dialog control how would i open a html file to a webbrowser window and also how would i save the html file if it were changed useing the common dialog save option?
Thanks
Printable View
ok useing the common dialog control how would i open a html file to a webbrowser window and also how would i save the html file if it were changed useing the common dialog save option?
Thanks
Code:'Open
CommonDialog1.CancelError = True
'CommonDialog1.Flags = (whatever flags you want)
On Error GoTo ErrHandler
CommonDialog1.Filter = "HTM Files (*.htm)|*.htm|All Files (*.*)|*.*|"
CommonDialog1.FilterIndex = 1
CommonDialog1.ShowOpen
Open CommonDialog1.filename For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1
Exit Sub
ErrHandler:
'End Sub
'Save
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
'CommonDialog1.Flags = (whatever flags you want)
CommonDialog1.Filter = "HTM Files (*.htm)|*.htm|All Files (*.*)|*.*|"
CommonDialog1.FilterIndex = 1
CommonDialog1.ShowSave
Open CommonDialog1.filename For Output As #1
Print #1, Text1
Close #1
Exit Sub
ErrHandler:
'End Sub