emulating numbered list button click from WPToolBar

  • I'm trying to create a shortcut key that will allow users to create a numbered list in the exact fashion as clicking the numbered list button in the WPToolbar.

    Ideally I'd like to just call the WPToolbar button directly, or by using the group number etc, but can't see any way to do that.

    This does toggle the list like the button, but does not indent the same way. Is there a better way to do this?

    Code
    if WPRichText1.CurrAttr.NumberStyle = 3 then begin
        WPRichText1.CurrAttr.NumberStyle := 0;
        WPRichText1.SetFocus;
      end else begin
        WPRichText1.CurrAttr.NumberStyle := 3;
        WPRichText1.SetFocus;
      end;