Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opening .pdf or .doc files in Toolbar with WebBrowser
#4
Function OpenInTbWebBrowser
Code:
Copy      Help
;/
function $url [$tbname]

;Opens url in web browser control on a QM toolbar.
;Example of adding web browser control to a toolbar is in c:\program files\quick macros 2\installed files\samples2.qml.


;url - a URL or a local file of supported format (htm, txt, doc, xls, pdf, gif, folder, etc).
;tbname - toolbar name. Can be omitted when this function is called directly from the toolbar.


;EXAMPLE (toolbar)
;;/hook ToolbarExProc_TWWB /siz 500 300 /set 2
;www.quickmacros.com :OpenInTbWebBrowser "http://www.quickmacros.com" * web.ico
;Book1.xls :OpenInTbWebBrowser "$personal$\Book1.xls" * $personal$\Book1.xls



int h
str s=tbname
if(s.len) h=win(s.ucase "QM_toolbar")
else h=val(_command) ;;if called from tb, tb handle is stored in _command
SHDocVw.WebBrowser b._getcontrol(child("" "ActiveX" h))
b.Navigate(_s.expandpath(url))
err+ out _error.description

---

Quote:How Do I modify the hook function to allow this.

Will each menu item have to call up a separate ToolbarExProc_TWWB function to make this work?

By the way, what is the purpose of multiple website/file listings in the function?

Don't need to modify.
Each menu item have to call OpenInTbWebBrowser (see example inside the function).
Just an example. If initially it should be empty, use only "about:blank".


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)