Community
@lisaj98052 wrote:
Hi, I have been tring to open a html file from an toolbar button and darn! if I just cant get it to work. Thought I could use the following; (command "_.browser" "l:/CAD Web/Display/cadweb.html") but all I get is an empty page. Any clues as to how I can get this to work, thank any help is appreciated greatly.
Try
(startapp "C:\\Program files\\Internet Explorer\\iexplore.exe" "l:\\CAD Web\\Display\\cadweb.html")
HTH
Henrique
Alternatively:
(startapp "explorer" "l:\\CAD Web\\Display\\cadweb.html")
Will open the file using the default program assigned to the .html extension.
One more, to open the file using the default browser:
(defun defaultbrowser ( url / exe ) (if (setq exe (vl-registry-read "HKEY_CURRENT_USER\\Software\\Classes\\http\\shell\\open\\command")) (startapp (vl-string-subst url "%1" exe)) ) )
Call with
(defaultbrowser "l:\\CAD Web\\Display\\cadweb.html")
If you want to use the code directly as the macro for a toolbar button, you will need to substitute (chr 92) for the use of a backslash, as the backslash is a macro operator representing a pause for user input:
(defaultbrowser (strcat "l:" (chr 92) "CAD Web" (chr 92) "Display" (chr 92) "cadweb.html"))