On open execute VBA to remove RTF font face (1 Viewer)

vjee

New member
Local time
Yesterday, 23:12
Joined
Nov 15, 2018
Messages
1
Hi all,

First of all let me clarify that i'm a total noob with both Access and VBA but was recently tasked with some work regarding Access. I consider myself a little bit tech savy but i'm still experimenting.

I have a report that use a combination of different fields, text box and the likes. the main part of my report is a RTF field where users enter long (and short) paragraphs, and tend to copy and paste a lot.

When people copy/paste their content in the RTF field they don't really bother with the font, size and colour.

I'm trying to come up with a solution to remove the "custom formatting" (specifically the font face and font size) to keep a somewhat consistent look throughout the report.
I need to be able to keep the bold, underline, italicize etc.

I have read online that RTF fields are actually more like HTML tags but can't figure out how to remove them, especially when font face and font size are used on the same paragraph.

I can somewhat live without having the same sizing being applied throughout but really need help getting rid of other font face.

I already have a macro firing up when the report is opened to sort some information.

Thanks for helping me out.
 

Cronk

Registered User.
Local time
Today, 17:12
Joined
Jul 4, 2013
Messages
2,770
You can use the inbuilt function PlainText to convert rtf to plain.


Then again, why not change the rtf property of the field to plain text and the formatted text will be converted when pasting.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:12
Joined
Oct 29, 2018
Messages
21,358
I need to be able to keep the bold, underline, italicize etc.


I think that's going to be tough. It might take a little bit of code to do it.


Just thinking out loud...
 

Users who are viewing this thread

Top Bottom