RTF2 Rich Text Control

A

Alan B. Densky

Hi Stephen,

I'm having a problem with the RTF2 text justification. I have the control
on a subform. If I use the right-click pop-up menu, everything works
correctly.

I don't want to use the toolbar because I would have to resize my forms, so
I moved the code to buttons (that look like a toolbar) that are located
directly on my form. Absolutely every function works correctly from these
command buttons except the Left, Center, Right, and Full justification
functions.

When I click the Center Align, I get the rtf \qr\ and it right aligns.
When I click the Left and the Center, I don't get any rtf codes.
When I click the Right I get the rft code removed and it Left justifies the
text.
When I click Full Justify, I get rtf \qj\
I've triple checked my code. Any ideas? Thanks in advance.

Alan B. Densky
 
A

Alan B. Densky

Never mind. I assigned the numerical values instead of using the rftLeft
etc, and that fixed it.

Alan B. Densky
 
S

Stephen Lebans

Since the sample Button Toolbar I supplied works correctly the issue
must/should be with the code behind your CommandButton controls. Verify
that my sample Toolbar functions correctly for the Alignment buttons
then copy the exact code behind your own Toolbar.

I do not use the ToolBar myself since the control has a built in Popup
menu. If I remember correctly, the sample code behind the ToolBar uses
the Screen.ActiveControl property. Since you are using CommandButtons
instead of ToolBar buttons the ActiveControl would become the
CommandButton instead of the RTF control. Try issuing a SetFocus command
to the RTF2 control prior to invoking your code.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
A

Alan B. Densky

Hi Stephen,

Yes, I had all ready changed to the SetFocus command when I transported the
code to my command buttons, and I quadruple checked the code, which was
correct both in your toolbar's module, and in my command button's OnClick
event.

However, for some reason my mdb didn't like the rftLeft, rftRight etc. But
it does work correctly when I assign the numerical values Left = 1, Right =
2, etc.

So at this point I'm happy, thank you very much for creating the control and
making it available, and the advice. Now I have one codebase that works in
all Access versions including A 2003, and I still have the rtf fields
working, instead of someone else's advice of using HTML!!!

Thanks Again!
Alan B. Densky
 

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