Load and show local html file

hello to all

I’m having trouble loading a html file in DefaultDir without calling filledialog.
I can not find reference to help me.
Anyone can teach me?

Rui

  Dim f As FolderItem 
  
  f = GetOpenFolderItem("int.html")
  If f <> Nil Then
    HTMLViewer1.LoadPage(f)
  End If
  
  

Use getFolderItem instead of GetOpenFolderItem.

Just remember that by default, GetFolderItem looks inside the same folder as your application (or your project, if you’re running it from within the IDE), so you need to specify the full path to the file. Like this:

 f = specialFolder.userHome.child("htmldocs").child("int.html")

(This is just an example: it will fail if you don’t have a folder called “htmldocs” in your home directory.You should enclose it with a try-end try and check for exceptions in case any of the file lookups fail.)

understood
works fine the way i want.

  Dim f As FolderItem 
  f = GetFolderItem("libs\\int.html")
  If f <> Nil Then
    HTMLViewer1.LoadPage(f)
  End If

thanks for the explanation Marc.

Rui