Re: bold/italic formatting in userform textbox

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jay Freedman (jay.freedman_at_verizon.net)
Date: 08/20/04


Date: Fri, 20 Aug 2004 19:37:03 -0400

Thanks, Steve, that's a great help. Now I'll have to go Google the
rest of the left-out---in-the-cold controls.

--
Regards,
Jay Freedman              http://aspnet2.com/mvp.ashx?JayFreedman
Microsoft Word MVP        FAQ: http://word.mvps.org
"Steve Lang" <nowhere@Nohow.not> wrote:
>Hi Jay and Katherine,
>
>there is a work around so you can use the Richtext box. On the development
>machine you need to change a specific Registry Setting:
>
>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ActiveX
>Compatibility\{3B7C8860-D78F-101B-B9B5-04021C009402}
>
>Change the "Compatibility Flags" DWord value to 0 (0x400 is a kill bit)
>
>Now you will be prompted to trust loading the control and it will run.
>
>It works for me!
>
>HTH and have a great day!
>
>Steve
>
>
>"Jay Freedman" <jay.freedman@verizon.net> wrote in message
>news:eSbWTguhEHA.2916@TK2MSFTNGP12.phx.gbl...
>> Hi Katherine,
>>
>> If you always want the contents of the textbox to be formatted that way,
>you
>> can set the formatting at design time and you won't need any code. Select
>> the textbox, go to the Properties pane, and click the Font item. A button
>> with "..." appears to the right of the font name; click it to open the
>> standard Font Properties dialog. Choose whatever formatting you want -- 
>> font, weight, size, color -- and click OK.
>>
>> You need code in a Click() procedure or in the TextBox1_Change() procedure
>> only if you want to change the formatting depending on some other
>> condition -- for example, only if the text is too long, or contains
>certain
>> characters.
>>
>> If you want only part of the text in the box to be italic or bold, I don't
>> think that's possible in an ordinary textbox. There's a type of control
>> called a Rich Edit textbox, which has much more formatting flexibility.
>> Unfortunately, you can't use the Microsoft Rich Edit control in recent
>> versions of Office because it isn't secure, and VBA won't let you place
>one
>> on a userform. You may be able to find a signed Rich Edit control from a
>> third-party vendor.
>>
>> -- 
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP          FAQ: http://word.mvps.org
>>
>> Bryan wrote:
>> > Sure,
>> >
>> > Private Sub CommandButton1_Click()
>> >   Me.TextBox1.Font.Bold = True
>> >   Me.TextBox1.Font.Italic = True
>> > End Sub
>> >
>> > HTH!
>> > ...Bryan
>> >
>> > "Katherine" <Katherine@discussions.microsoft.com> wrote in message
>> > news:B5910A24-EA45-411C-A98D-758D84F760C6@microsoft.com...
>> >> Is it possible to apply bold or italic formatting to something keyed
>> >> into a textbox in a userform, either by a shortcut key or coding a
>> >> button on the form to bold/italicise a selection?
>>
>>
>

Quantcast