RichTextBox alternative in VBA

D

DoctorRaf

I have an application in Excel that uses a RichTextBox control on a
UserForm. Now that my work has updated to Office 2003, the program
loads without this control. Doing some searching, I found that this was
actually intended by Microsoft - why they don't provide a reasonable
workaround or alternative control, I don't know.

Others have found cumbersome workarounds. See:

http://groups.google.com/group/micr...read/thread/3ef04a2f2a8cef1e/76252635e022bb41


All I want is a control that allows users to input text, word-wraps,
and allows copying and pasting. No pictures or fancy formatting is
required.

Does anyone know of a control I can use in place of the RichTextBox? Or
a simpler, more robust workaround that does not involved changing the
registry?

Thanks a ton. A token gift to anyone with a solution I adopt.
 
C

Cindy M.

I have an application in Excel that uses a RichTextBox control on a
UserForm. Now that my work has updated to Office 2003, the program
loads without this control. Doing some searching, I found that this was
actually intended by Microsoft - why they don't provide a reasonable
workaround or alternative control, I don't know.

Others have found cumbersome workarounds. See:

http://groups.google.com/group/microsoft.public.office.developer.vba/browse_thread/t
hread/3ef04a2f2a8cef1e/76252635e022bb41


All I want is a control that allows users to input text, word-wraps,
and allows copying and pasting. No pictures or fancy formatting is
required.

Does anyone know of a control I can use in place of the RichTextBox? Or
a simpler, more robust workaround that does not involved changing the
registry?
As I recall, there is (or was) a Knowledge Base article on this and the reason
behind the controls not working is a security measure - they aren't signed as "safe
for initialization". The workaround I remember (the one I can't find today) is to
use the control in a classic VB project (wrap it) and create your own ActiveX
control that you can then sign as "safe for initialization"

I know of no other RichText controls that can be used with Office, although "in
extremis" I suppose you could embed a Word document on a worksheet.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply in
the newsgroup and not by e-mail :)
 
A

Andy Pope

Hi,

If no fancy formatting is required why will a normal textbox not work
for you.

EnteryBehaviour = True
WordWrap = True
MultiLine = True

The textbox supports Cut/Copy/Paste.

If you want a right-click context menu of those commands you can add
that by creating commandbar buttons and using the showpopup method.

Cheers
Andy
 
D

DoctorRaf

Andy wins the prize! His suggestion led me to a useful workaround using
a textbox.

Thanks! I'll send you an e-mail with a gift.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top