I want to open a local HTML file in the default browser.
For example: Default Browser is Mozilla Firefox.
The file to be opened: C:\\My Custom Path\\New Folde
Unfortunately you can't do it only with ShellExecute. But there is some hack.
For example you want to open url like this:
C:\Users\User\Desktop\Some sitename with spaces.htm with the anchor #myAnchor
To make ShellExecute open file:
vS := 'file:///C:\Users\User\Desktop\Some sitename with spaces.htm#MyAnchor';
ShellExecute(0, 'OPEN', PChar(vS), '', '', SW_SHOWNORMAL);
It's Important to use "file:///" in the beginning, but ShellExecute open this page without anchor.
To open with the anchor you can dynamically create html file with content like this:
And open this dynamic file with ShellExecute.
Hope it helps.