Opening a 'file:' URL an Anchor
Keywords: anchor htm html open file
Question:
I want to do this with the default browser (i.e., I don't want to specify which browser to run). This runs just fine:URL = "file://F:\path\file.htm" RunShell("cmd.exe", StrCat("/c start ", URL), ".", @NORMAL, @NOWAIT)But if URL = "file://F:\path\file.htm#Introduction", I get a 'Problem with Shortcut' dialog stating 'Unable to open "file://F:\path\file.htm#Introduction"'.Note that a bookmark in an "http:" URL works with RunShell.
Answer:
- The #Introduction part might be confusing the issue. Generally it is information retained by the Browser.
- Try the ShellExecute function instead of RunShell.
- If that failes I can tell you how to make an Internet shortcut. Basically make an error occur, click on our connect to tech support link, then go look in your TEMP directory for a file like $$$TEMP.url
View this file in DOS to see its structure. We just ShellExecute the file to make the connection.
Question (continued):
I tried ShellExecute and the Internet shortcut some time ago. Both produce the same error as RunShell.So does running "file://F:\path\file.htm#Introduction" from Start->Run.
I think it's because the "#Introduction" obscures the .htm extension. Sure wish I knew a way to do this without registry lookups.
Answer:
The # introduction is the responsibility of the Browser. It should strip the #Introduction off. Apparently the browser you are using is not.
Article ID: W13356Filename: Opening an HTM File with an Anchor.txt