Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Hallsjo Hallsjo is offline
external usenet poster
 
Posts: 11
Default Create character style that "imitates" Text Highlight Color

All our templates are locked (limit formatting to a selection of styles...),
and I want to supply the users with a character style that can be used the
same way as the Text Highlight Color tool. I have created a character style
applied a color in the Shading dialogue. This is not the only character style
in the template. There are also styles for bold and italic. The "text
coloring" style works well as long as there are no other character styles
applied to the text. For instance, if I select a word in a paragraph and mark
it as bold using the character style for bold text. If I then I expand the
selection to include both the text marked as bold and other text and apply
the "coloring style", the bold style is removed. If I then reapply the bold
style, the coloring disappears. What I want is to create a style that works
the same way as the Text Highlight Color tool which seems to not affect the
text it is applied to, except for coloring it of course.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Create character style that "imitates" Text Highlight Color

Unfortunately styles don't work like that. You would need a macro or allow
the users to apply shading or even to use the highlighter to achieve this
effect.

The macro code to colour the selected text background whilst ignoring the
text formatting would be:

Selection.Shading.BackgroundPatternColor = wdColorYellow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Hallsjo wrote:
All our templates are locked (limit formatting to a selection of
styles...), and I want to supply the users with a character style
that can be used the same way as the Text Highlight Color tool. I
have created a character style applied a color in the Shading
dialogue. This is not the only character style in the template. There
are also styles for bold and italic. The "text coloring" style works
well as long as there are no other character styles applied to the
text. For instance, if I select a word in a paragraph and mark it as
bold using the character style for bold text. If I then I expand the
selection to include both the text marked as bold and other text and
apply the "coloring style", the bold style is removed. If I then
reapply the bold style, the coloring disappears. What I want is to
create a style that works the same way as the Text Highlight Color
tool which seems to not affect the text it is applied to, except for
coloring it of course.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Hallsjo Hallsjo is offline
external usenet poster
 
Posts: 11
Default Create character style that "imitates" Text Highlight Color

Thanks a lot! That seems to work like a charm. A bit cumbersome, but it works
and I am grateful for that. What would the reverse macro look like, i.e. a
macro for removing the color styling (I am not at all familiar with macro
coding). If I use the "clear formatting" command (Ctrl+space) all formatting,
also the initial bold formatting, i removed. It would be helpful to be able
to just remove the color styling.

Again, thanks for a rapid reply to my enquiry.

"Graham Mayor" wrote:

Unfortunately styles don't work like that. You would need a macro or allow
the users to apply shading or even to use the highlighter to achieve this
effect.

The macro code to colour the selected text background whilst ignoring the
text formatting would be:

Selection.Shading.BackgroundPatternColor = wdColorYellow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Hallsjo wrote:
All our templates are locked (limit formatting to a selection of
styles...), and I want to supply the users with a character style
that can be used the same way as the Text Highlight Color tool. I
have created a character style applied a color in the Shading
dialogue. This is not the only character style in the template. There
are also styles for bold and italic. The "text coloring" style works
well as long as there are no other character styles applied to the
text. For instance, if I select a word in a paragraph and mark it as
bold using the character style for bold text. If I then I expand the
selection to include both the text marked as bold and other text and
apply the "coloring style", the bold style is removed. If I then
reapply the bold style, the coloring disappears. What I want is to
create a style that works the same way as the Text Highlight Color
tool which seems to not affect the text it is applied to, except for
coloring it of course.




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Create character style that "imitates" Text Highlight Color

The following will toggle the backgound colour of the selected text between
yellow and no colour

Sub ToggleYellow()
With Selection.Shading
If .BackgroundPatternColor = wdColorAutomatic Then
.BackgroundPatternColor = wdColorYellow
Else
.BackgroundPatternColor = wdColorAutomatic
End If
End With
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Hallsjo wrote:
Thanks a lot! That seems to work like a charm. A bit cumbersome, but
it works and I am grateful for that. What would the reverse macro
look like, i.e. a macro for removing the color styling (I am not at
all familiar with macro coding). If I use the "clear formatting"
command (Ctrl+space) all formatting, also the initial bold
formatting, i removed. It would be helpful to be able to just remove
the color styling.

Again, thanks for a rapid reply to my enquiry.

"Graham Mayor" wrote:

Unfortunately styles don't work like that. You would need a macro or
allow the users to apply shading or even to use the highlighter to
achieve this effect.

The macro code to colour the selected text background whilst
ignoring the text formatting would be:

Selection.Shading.BackgroundPatternColor = wdColorYellow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Hallsjo wrote:
All our templates are locked (limit formatting to a selection of
styles...), and I want to supply the users with a character style
that can be used the same way as the Text Highlight Color tool. I
have created a character style applied a color in the Shading
dialogue. This is not the only character style in the template.
There are also styles for bold and italic. The "text coloring"
style works well as long as there are no other character styles
applied to the text. For instance, if I select a word in a
paragraph and mark it as bold using the character style for bold
text. If I then I expand the selection to include both the text
marked as bold and other text and apply the "coloring style", the
bold style is removed. If I then reapply the bold style, the
coloring disappears. What I want is to create a style that works
the same way as the Text Highlight Color tool which seems to not
affect the text it is applied to, except for coloring it of course.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Hallsjo Hallsjo is offline
external usenet poster
 
Posts: 11
Default Create character style that "imitates" Text Highlight Color

Again, thanks for a rapid, and functional, reply to my question. This worked
very well and I am grateful.One final question. Am I going about this the
wrong way? Is there a way to selectively activate formatting commands when I
have limited what users can do? In this case I am only interested in allowing
the users to select and markup text in different colours.

"Graham Mayor" wrote:

The following will toggle the backgound colour of the selected text between
yellow and no colour

Sub ToggleYellow()
With Selection.Shading
If .BackgroundPatternColor = wdColorAutomatic Then
.BackgroundPatternColor = wdColorYellow
Else
.BackgroundPatternColor = wdColorAutomatic
End If
End With
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Hallsjo wrote:
Thanks a lot! That seems to work like a charm. A bit cumbersome, but
it works and I am grateful for that. What would the reverse macro
look like, i.e. a macro for removing the color styling (I am not at
all familiar with macro coding). If I use the "clear formatting"
command (Ctrl+space) all formatting, also the initial bold
formatting, i removed. It would be helpful to be able to just remove
the color styling.

Again, thanks for a rapid reply to my enquiry.

"Graham Mayor" wrote:

Unfortunately styles don't work like that. You would need a macro or
allow the users to apply shading or even to use the highlighter to
achieve this effect.

The macro code to colour the selected text background whilst
ignoring the text formatting would be:

Selection.Shading.BackgroundPatternColor = wdColorYellow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Hallsjo wrote:
All our templates are locked (limit formatting to a selection of
styles...), and I want to supply the users with a character style
that can be used the same way as the Text Highlight Color tool. I
have created a character style applied a color in the Shading
dialogue. This is not the only character style in the template.
There are also styles for bold and italic. The "text coloring"
style works well as long as there are no other character styles
applied to the text. For instance, if I select a word in a
paragraph and mark it as bold using the character style for bold
text. If I then I expand the selection to include both the text
marked as bold and other text and apply the "coloring style", the
bold style is removed. If I then reapply the bold style, the
coloring disappears. What I want is to create a style that works
the same way as the Text Highlight Color tool which seems to not
affect the text it is applied to, except for coloring it of course.






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Create character style that "imitates" Text Highlight Color

I'm afraid that if you are going to cripple the functions available in Word
for some reason, this will be something you have to live with. User training
might be a better plan?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Hallsjo wrote:
Again, thanks for a rapid, and functional, reply to my question. This
worked very well and I am grateful.One final question. Am I going
about this the wrong way? Is there a way to selectively activate
formatting commands when I have limited what users can do? In this
case I am only interested in allowing the users to select and markup
text in different colours.

"Graham Mayor" wrote:

The following will toggle the backgound colour of the selected text
between yellow and no colour

Sub ToggleYellow()
With Selection.Shading
If .BackgroundPatternColor = wdColorAutomatic Then
.BackgroundPatternColor = wdColorYellow
Else
.BackgroundPatternColor = wdColorAutomatic
End If
End With
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Hallsjo wrote:
Thanks a lot! That seems to work like a charm. A bit cumbersome, but
it works and I am grateful for that. What would the reverse macro
look like, i.e. a macro for removing the color styling (I am not at
all familiar with macro coding). If I use the "clear formatting"
command (Ctrl+space) all formatting, also the initial bold
formatting, i removed. It would be helpful to be able to just remove
the color styling.

Again, thanks for a rapid reply to my enquiry.

"Graham Mayor" wrote:

Unfortunately styles don't work like that. You would need a macro
or allow the users to apply shading or even to use the highlighter
to achieve this effect.

The macro code to colour the selected text background whilst
ignoring the text formatting would be:

Selection.Shading.BackgroundPatternColor = wdColorYellow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Hallsjo wrote:
All our templates are locked (limit formatting to a selection of
styles...), and I want to supply the users with a character style
that can be used the same way as the Text Highlight Color tool. I
have created a character style applied a color in the Shading
dialogue. This is not the only character style in the template.
There are also styles for bold and italic. The "text coloring"
style works well as long as there are no other character styles
applied to the text. For instance, if I select a word in a
paragraph and mark it as bold using the character style for bold
text. If I then I expand the selection to include both the text
marked as bold and other text and apply the "coloring style", the
bold style is removed. If I then reapply the bold style, the
coloring disappears. What I want is to create a style that works
the same way as the Text Highlight Color tool which seems to not
affect the text it is applied to, except for coloring it of
course.



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Hallsjo Hallsjo is offline
external usenet poster
 
Posts: 11
Default Create character style that "imitates" Text Highlight Color

Yes, I guess you are right. I would like Word to be less blunt when it comes
to limiting what users can do. Anyway, thanks for your help and input which
is most appreciated.

"Graham Mayor" wrote:

I'm afraid that if you are going to cripple the functions available in Word
for some reason, this will be something you have to live with. User training
might be a better plan?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Hallsjo wrote:
Again, thanks for a rapid, and functional, reply to my question. This
worked very well and I am grateful.One final question. Am I going
about this the wrong way? Is there a way to selectively activate
formatting commands when I have limited what users can do? In this
case I am only interested in allowing the users to select and markup
text in different colours.

"Graham Mayor" wrote:

The following will toggle the backgound colour of the selected text
between yellow and no colour

Sub ToggleYellow()
With Selection.Shading
If .BackgroundPatternColor = wdColorAutomatic Then
.BackgroundPatternColor = wdColorYellow
Else
.BackgroundPatternColor = wdColorAutomatic
End If
End With
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Hallsjo wrote:
Thanks a lot! That seems to work like a charm. A bit cumbersome, but
it works and I am grateful for that. What would the reverse macro
look like, i.e. a macro for removing the color styling (I am not at
all familiar with macro coding). If I use the "clear formatting"
command (Ctrl+space) all formatting, also the initial bold
formatting, i removed. It would be helpful to be able to just remove
the color styling.

Again, thanks for a rapid reply to my enquiry.

"Graham Mayor" wrote:

Unfortunately styles don't work like that. You would need a macro
or allow the users to apply shading or even to use the highlighter
to achieve this effect.

The macro code to colour the selected text background whilst
ignoring the text formatting would be:

Selection.Shading.BackgroundPatternColor = wdColorYellow

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Hallsjo wrote:
All our templates are locked (limit formatting to a selection of
styles...), and I want to supply the users with a character style
that can be used the same way as the Text Highlight Color tool. I
have created a character style applied a color in the Shading
dialogue. This is not the only character style in the template.
There are also styles for bold and italic. The "text coloring"
style works well as long as there are no other character styles
applied to the text. For instance, if I select a word in a
paragraph and mark it as bold using the character style for bold
text. If I then I expand the selection to include both the text
marked as bold and other text and apply the "coloring style", the
bold style is removed. If I then reapply the bold style, the
coloring disappears. What I want is to create a style that works
the same way as the Text Highlight Color tool which seems to not
affect the text it is applied to, except for coloring it of
course.




Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to replace "enter character" with "space character" in msword MS-Word Microsoft Word Help 2 May 9th 23 08:52 AM
Changing 'Highlight" color Dave New Users 7 December 27th 08 02:38 PM
How do I create a style with the text "NOTE:" at the begining? jforsyth12 New Users 8 September 25th 08 05:01 PM
My character style has become a "paragraph and character" style Eric Microsoft Word Help 1 December 11th 07 10:12 AM
How do I change the highlight color of "selected" text? Dave Smith Microsoft Word Help 1 October 29th 07 06:40 PM


All times are GMT +1. The time now is 10:47 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"