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
i think this is better way:
function OpenHtmlFile(FileAdr :string):Boolean;
var
vTempFile :string;
vData :TStrings;
begin
Result:= False;
vTempFile:= GetTempFolder + '_tmphtmlrunfile.html';
vData:= TStringList.Create;
vData.Text:= '';
try
try
vData.SaveToFile(vTempFile, TEncoding.UTF8);
finally
vData.Free;
end;
ShellExecute(Handle,
'open',
PChar(vTempFile),
nil,
nil,
SW_SHOWNORMAL);
Result:= True;
except
end;
end;