2

I've written an external help file in HMTL for use with an access 2007 database. However, I can find no way of calling the HTML file if the URL has an anchor "#" code at the end. For example, this fails:

  Dim szAnchor As String
  szAnchor = "Options"
  szPathname = Application.CurrentProject.Path & "\Help\Help.html" & _
      IIf(szAnchor <> "", "#" & szAnchor, "")
  Application.FollowHyperlink szPathname

as does

  szPathname = Application.CurrentProject.Path & "\Help\Help.html"
  Application.FollowHyperlink szPathname, szAnchor

So do attempts to use Shell and ShellExecute.

Can somebody suggest a solution? Otherwise, I shall have to recreate the help file in another format!

Erik A
  • 31,639
  • 12
  • 42
  • 67
  • I should have said that FollowHyperlink loads the HTML file but doesn't send the anchor text in the URL. The Shell and ShellExecute functions fail if an "#" is inthe URL. –  Feb 04 '17 at 12:30
  • How exactly does ShellExecute fail? Using the code from http://stackoverflow.com/a/13708170/3820271 , `fHandleFile "https://en.wikipedia.org/wiki/Fragment_identifier#Proposals", WIN_NORMAL` works as it should. But of course that's a web site, not a html file. – Andre Feb 04 '17 at 18:32
  • Yes, that seems to be the difference.The example you give certainly works. But not with calling a local file. With ShellExecute, starting the URL with "file:///" opens the file in the browser but truncates the URL, removing the anchor. –  Feb 05 '17 at 09:21

0 Answers0