Solved

Style to change highlight/font whilst maintaining word colouring!

Posted on 2010-11-30
11
788 Views
Last Modified: 2012-05-10
Ah hello.

I am using Word 2007, and I would like to create a style that changes the background of the text to grey, the font to courier, but keeps the colouring of the original words the same.  Please see the image below.  

Required style result
I can figure out how to get the font to change to courier, but I can't see how to get the background to grey without applying it to the whole paragraph (I only want to apply it to the *selection*).  Also, Word does not seem to remember the original colour of the words when I apply the font: they all go to black.

Secondly, can someone tell me how, once this style is setup, to get Word to ignore the spelling of any parts of the document that have this style applied please?

(100 points/question)

TIA
0
Comment
Question by:mrwad99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 32

Accepted Solution

by:
Paul Sauvé earned 200 total points
ID: 34242534
Hi Mr. Wade,

eureka -

1 - select the text
2 - select Borders and Shading
choose a colour3 - select Shading tab and choose a colour
Borders and Shading4 - create a new Character style
 Denfine new style5 - Use as required

I did this in Word 2010, but it should work in Word 2007.

PaulS
0
 
LVL 32

Expert Comment

by:Paul Sauvé
ID: 34242601
Here's the file... Test-Galil-e---Einstein.docx
0
 
LVL 19

Author Comment

by:mrwad99
ID: 34246728
Hi paulsauve,

Thanks for that.  I downloaded your document and tried the style: it works fine apart from the fact that if you apply the style to words that have different colours, the original colours is forgotten: they all go black.  See the image below.
 Prob
Is there any way we can maintain the original colouring of the words, just change the font and the highlight?
0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 32

Assisted Solution

by:Paul Sauvé
Paul Sauvé earned 200 total points
ID: 34251854
Use ONLY select Shading tab and choose a colour. However, you won't be able to define a style. Alternatively, use the Text Highlight tool.
0
 
LVL 19

Author Comment

by:mrwad99
ID: 34255988
Use ONLY select Shading tab and choose a colour

Sorry, I don't understand what you mean.  I am not a very competent Word user at the best of times (I don't have need to be) so can you explain in simple terms please?

TIA
0
 
LVL 32

Expert Comment

by:Paul Sauvé
ID: 34258751
"Use ONLY select Shading tab and choose a colour" See "2 - select Borders and Shading" as above
OR

Select the text

Select Text highlight color:Select colour
Select colour:Text highlight color tool
Is that ok?
0
 
LVL 19

Author Comment

by:mrwad99
ID: 34259203
Oh right, I understand you now.  So basically you are saying take the paragraph shading out of the style and apply it manually.

Not really what I wanted, but I was playing with macros and it seems I can do all of this without having to define a style: I can just record the steps to change the highlight of the selected text, then change the font and font size etc.

Either way, you have helped me, so thanks.  The points are yours :)
0
 
LVL 32

Expert Comment

by:Paul Sauvé
ID: 34259311
If you create a macro, FIRST, you have to be able to locate the string of text that is NOT the same colour as the rest of the text in the document.



0
 
LVL 19

Author Comment

by:mrwad99
ID: 34259349
I don't see what you mean.  The macro body is

    Options.DefaultHighlightColorIndex = wdGray25
    Selection.Range.HighlightColorIndex = wdGray25
    Selection.Font.Name = "Courier New"

which simply gets the highlighted text, then changes the highlight colour and font.  It leaves everything else in the selection the same, which includes the words colouring.
0
 
LVL 32

Expert Comment

by:Paul Sauvé
ID: 34263131
Yes, but how does the macro find the text to highlight? That was my point of the above comment.
0
 
LVL 19

Author Comment

by:mrwad99
ID: 34265565
No, I have to highlight the text first.  But that is what I would be doing with styles anyway: I would highlight the text I wish to apply the style to, then click the style itself.  This does not have the benefit that I could not change the style, then have all pieces of text with that style applied updated automatically, but I am willing to accept this since retaining the original colouring of the words is too important.  Thanks again.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There is a feature provided by MS Word that lets you create an Table of Contents for your Word document automatically. To use this feature for other documents there are two steps involved,   1.  Prepare your document for a table of contents (he…
Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question