dbTalk Databases Forums  

to change the color of several parts in a text in RichText

comp.databases.ms-access comp.databases.ms-access


Discuss to change the color of several parts in a text in RichText in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michiel Rapati-Kekkonen
 
Posts: n/a

Default to change the color of several parts in a text in RichText - 03-26-2010 , 11:03 AM






Hi

I have a Text Box of which the Text Format is set to Rich Text.
The box is filled with texts containig certain elements that are surrounded
by brackets.
Those elements I would like to appear in a different color.

I have no experience (apart from some experimenting) with Rich Text, so I
don't even know if it is possible to colour several, different parts.
And then of course: How?

Any help appreciated!

Michiel


--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: to change the color of several parts in a text in RichText - 03-26-2010 , 09:22 PM






Presumably this is Access 2007.

You can select the text, and then use the ribbon to set the text color.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Michiel Rapati-Kekkonen" <no-mail (AT) nonsense (DOT) zz> wrote

Quote:
Hi

I have a Text Box of which the Text Format is set to Rich Text.
The box is filled with texts containig certain elements that are
surrounded by brackets.
Those elements I would like to appear in a different color.

I have no experience (apart from some experimenting) with Rich Text, so I
don't even know if it is possible to colour several, different parts.
And then of course: How?

Any help appreciated!

Michiel

--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #3  
Old   
Michiel Rapati-Kekkonen
 
Posts: n/a

Default Re: to change the color of several parts in a text in RichText - 03-27-2010 , 01:01 AM



Thanks for your response, Allen,
at least now I see Something happen,
but
I would like to do it programmatically.
So far I can select, by code, the parts I want, but when I then apply '
..SelColor = vbRed '
the error message is 438: Object doesn't support this property or method.
It is an unbound texbox, Enabled, Unlocked, with Text format set to Rich.

I'm using 2007 indeed.

The question remains: is it possible?

Michiel



"Allen Browne" <AllenBrowne (AT) SeeSig (DOT) invalid> wrote

Quote:
Presumably this is Access 2007.

You can select the text, and then use the ribbon to set the text color.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Michiel Rapati-Kekkonen" <no-mail (AT) nonsense (DOT) zz> wrote in message
news:hoipe1$1ebk$1 (AT) adenine (DOT) netfront.net...
Hi

I have a Text Box of which the Text Format is set to Rich Text.
The box is filled with texts containig certain elements that are
surrounded by brackets.
Those elements I would like to appear in a different color.

I have no experience (apart from some experimenting) with Rich Text, so I
don't even know if it is possible to colour several, different parts.
And then of course: How?

Any help appreciated!

Michiel

--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---


--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
  #4  
Old   
Allen Browne
 
Posts: n/a

Default Re: to change the color of several parts in a text in RichText - 03-27-2010 , 05:43 AM



Insert the HTML word around the desired text, e.g.:

Me.MyRichTextField = "This has a <font color=""#FF0000"">red</font> word."

You may need to use SelStart, Len(), Mid() etc to code this.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Michiel Rapati-Kekkonen" <no-mail (AT) nonsense (DOT) zz> wrote

Quote:
Thanks for your response, Allen,
at least now I see Something happen,
but
I would like to do it programmatically.
So far I can select, by code, the parts I want, but when I then apply '
.SelColor = vbRed '
the error message is 438: Object doesn't support this property or method.
It is an unbound texbox, Enabled, Unlocked, with Text format set to Rich.

I'm using 2007 indeed.

The question remains: is it possible?

Michiel

Reply With Quote
  #5  
Old   
Michiel Rapati-Kekkonen
 
Posts: n/a

Default Re: to change the color of several parts in a text in RichText - 03-27-2010 , 09:30 AM



Thanks, Allen, that's great.

This way it looks, unexpectedly, like a piece of cake.
And now it certainly looks better in my Rich Fields!

Michiel


"Allen Browne" <AllenBrowne (AT) SeeSig (DOT) invalid> wrote

Quote:
Insert the HTML word around the desired text, e.g.:

Me.MyRichTextField = "This has a <font color=""#FF0000"">red</font> word."

You may need to use SelStart, Len(), Mid() etc to code this.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Michiel Rapati-Kekkonen" <no-mail (AT) nonsense (DOT) zz> wrote in message
news:hokagn$10pp$1 (AT) adenine (DOT) netfront.net...
Thanks for your response, Allen,
at least now I see Something happen,
but
I would like to do it programmatically.
So far I can select, by code, the parts I want, but when I then apply '
.SelColor = vbRed '
the error message is 438: Object doesn't support this property or method.
It is an unbound texbox, Enabled, Unlocked, with Text format set to Rich.

I'm using 2007 indeed.

The question remains: is it possible?

Michiel


--- news://freenews.netfront.net/ - complaints: news (AT) netfront (DOT) net ---

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.