Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using bookmarks in local files with the Web Browser control

Status
Not open for further replies.

Alt255

Programmer
May 14, 1999
1,846
US
I'm trying to build a searchable interlinear bible with VB6. I have tried a couple of options for displaying the Unicode Hebrew and Greek, first using the InkEdit control and then using the web browser control. InkEdit didn't provide a way to programmatically search for a string and scroll there (like the rich text control). I even tried using the SetScrollInfo API (which repositioned the scroll bar to the correct values but didn't reposition the text). I don't know if that is the expected behavior but it isn't what I needed.
So I tried to use the web browser control. It was fairly easy to write 66 HTML pages with bookmarks and hyperlinks but I couldn't figure out a way to go to bookmarks, either in the currently loaded document or in any of the files on disk.
So... does anybody know a way to scroll the web browser control to a bookmark?
Maybe I am barking up the wrong tree. Other than WebKitX (way too expensive), is there an ActiveX that will do what I need? Or any combination of API calls, HTML and-or a third-party ActiveX?

Add water (makes its own sauce).
 
 https://files.engineering.com/getfile.aspx?folder=87f0d130-46c3-47c4-888d-ac163733de0a&file=screen_cap.jpg
Thanks. Opening a page with #BookmarkName appended to the URL isn't a problem. I can do that with the Web Browser control but it doesn't work with HTML files stored on disk. I could put a BrowserName.Document.body.ScrollTop = BookmarkLocation in DownloadComplete (If I had a reliable way to locate a bookmark in a page.) That really isn't what I was looking for but I would take it. (Better than wasting a half-hour trying make Document.getElementById("MahBookmark").ScrollIntoView work).
Your bigger question, why VB6: I'm an old man and I won't be alive long enough to learn a framework that might be abandoned right after I learn to use it. But thanks for asking


Add water (makes its own sauce).
 
>InkEdit didn't provide a way to programmatically search for a string and scroll there

Not quite true. It is perfectly feasible to search both an Inkedit control and a rich text control for text and to scroll to that found text through the use of windows Edit control API messages
 
Strongm, that sounds promising but I don't see a way to implement it (aside from getting an EM_LINEFROMCHAR and using EM_LINESCROLL to go there. I've tried a similar approach (non API) with the browser control using Document.body.ScrollTop and Document.parentWindow.scrollBy (the results haven't been great). How would you do a clean search and scroll on an Inkedit control using the API?


Add water (makes its own sauce).
 
Ifc you have already been looking at the EM_ messages, then you already are looking at the ideas I am talking about.
 
Always the teacher, Mike. Thanks. :)

Add water (makes its own sauce).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top