DelphiDabbler Code Snippets Database

Snippet Selection

The following snippets from the Code Snippets Database have been requested.

WBClearSelection

De-selects any selected text in the given brower control's current document. Does nothing if the current document does not support the DOM or if no document is loaded.

procedure WBClearSelection(WB: SHDocVw.TWebBrowser);
begin
  WBInvokeCmd(
    WB,
    False,
    SHDocVw.OLECMDID_CLEARSELECTION,
    SHDocVw.OLECMDEXECOPT_DODEFAULT
  );
end;

WBRedo

Redoes the last undo operation in the document curreently loaded in the given web browser control. Does nothing if no undo operation has taken place or if the current document does not support the DOM.

procedure WBRedo(WB: SHDocVw.TWebbrowser);
begin
  WBInvokeCmd(
    WB,
    False,
    SHDocVw.OLECMDID_REDO,
    SHDocVw.OLECMDEXECOPT_DODEFAULT
  );
end;

WBSelectAll

Selects all the text in the given web browser control's current document. Does nothing if the document does not have focus or does not support the DOM.

procedure WBSelectAll(WB: SHDocVw.TWebbrowser);
begin
  WBInvokeCmd(
    WB,
    False,
    SHDocVw.OLECMDID_SELECTALL,
    SHDocVw.OLECMDEXECOPT_DODEFAULT
  );
end;

WBUndo

Undoes the last edit in the given web browser control's current document. Does nothing if no document is loaded or if the document does not support the DOM.

procedure WBUndo(WB: SHDocVw.TWebbrowser);
begin
  WBInvokeCmd(
    WB,
    False,
    SHDocVw.OLECMDID_UNDO,
    SHDocVw.OLECMDEXECOPT_DODEFAULT
  );
end;

View the whole database.

Go to the DelphiDabbler website.