This is a documentation error in the Delphi Help. If you look in Microsoft's Platform SDK documentation you will find the following: "if the beginning of the history list has been reached the IWebBrowser2::GoBack method should not be used."
If you want to have a button or similar component that will allow you to GoBack and another button that will let you GoForward using the TWebBrowser component, here is an example of the best way to proceed that will avoid the unspecified error.
In your application drop a TWebBrowser component on the form and two button components. Name the first Button btnBack and the next button btnForward. For both of these buttons, change the enabled property to False. In the OnClick event of btnBack the code should look like this:
procedure TForm1.btnBackClick(Sender: TObject);
begin
WebBrowser1.GoBack;
end;
procedure TForm1.btnForwardClick(Sender: TObject);
begin
WebBrowser1.GoForward;
end;
procedure TForm1.WebBrowser1CommandStateChange(Sender: TObject;
Command: Integer; Enable: WordBool);
begin
case Command of
CSC_NAVIGATEBACK: btnBack.Enabled := Enable;
CSC_NAVIGATEFORWARD: btnForward.Enabled := Enable;
end;
end;
Last Modified: 16-SEP-01