change the Uppercase of selected text in the WPRichText1

  • good morning ... I'm trying to find a property or function that allows me to change selected text to uppercase in WPRichText1, and use the following code does not work:

    WPRichText1.BeginUpdate;
    PRichText1.SelectedTextAttr.SetCharStyles (WPSTY_UPPERCASE, WPSTY_UPPERCASE);
    WPRichText1.EndUpdate;


    using delphi 7..
    in advance thanks to who can help ...
    Juan Santana

  • hi, got the functions. For whatever it useful.
    inside the samples folder wp


    ..:uppercase text selected:..

    if WPRichText1 <> nil then
    begin
    with WPRichText1.TextCursor.CurrAttribute do
    begin
    BeginUpdate;
    ExcludeStyle(afsLowercaseStyle);
    IncludeStyle(afsUppercaseStyle);
    EndUpdate;
    end;
    WPRichText1.Refresh;
    end;

    ..:lowercase:..

    if WPRichText1 <> nil then
    begin
    with WPRichText1.TextCursor.CurrAttribute do
    begin
    BeginUpdate;
    ExcludeStyle(afsUppercaseStyle);
    IncludeStyle(afsLowercaseStyle);
    EndUpdate;
    end;
    WPRichText1.Refresh;
    end;