Solved

Highlight Rich Text Content Control

Posted on 2014-09-19
4
287 Views
Last Modified: 2015-06-30
I have a simple Word document I use in Word 2007 and 2010 that includes some rich text content controls as per the image below:

Rich Text Content Control Example
In this document there are several such controls and I feel that unless we can make these stand out (for example by highlighting the border in red) some controls may get missed.

Apart from entering some text and making it a different colour, is there a simple way to either make these stand out or force users to enter all items.
0
Comment
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 40332158
It's not clear why changing the text colour is unsatisfactory. There are several other ways to change the appearance of text, including font type and size, highlighting, borders and shading, underlining and putting it in a text box.

You would need to use VBA code to check that none of the controls are left with the default text.
0
 

Author Comment

by:Computer_Support_Norwich
ID: 40332629
Hi, many thanks for your response.

Changing the text colour inside the control is not ideal because once a user fills in that rich text control they will have to reset the text colour back to black which is an additional step in the edit process. Not a huge one of course so we might do that and live with it.

What VBA did you have in mind...? I've regularly used VBA in access development but never, ever done VBA in Word so if you have a sample that would be great!
0
 
LVL 32

Assisted Solution

by:Rob Henson
Rob Henson earned 200 total points
ID: 40333014
I believe you can have Form Fields shown as a grey box.

Thanks
Rob H
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 300 total points
ID: 40333229
Here is a sample macro to count the unfilled fields and to reset the colour if they have been filled in.
Sub CheckCCS()
    Dim cc As ContentControl
    Dim iNotDone As Integer
    
    For Each cc In ActiveDocument.ContentControls
        If cc.Range.Text = cc.PlaceholderText Then
            iNotDone = iNotDone + 1
        Else
            cc.Range.Font.Color = wdColorAutomatic
        End If
    Next cc
    If iNotDone > 0 Then
        If iNotDone = 1 Then
            MsgBox "There is still a field to be filled in."
        Else
            MsgBox "There are still " & iNotDone & " fields to be filled in."
        End If
    Else
       MsgBox "All fields have been filled."
    End If
        
End Sub

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now