Solved

Highlight Rich Text Content Control

Posted on 2014-09-19
4
334 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
[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
  • 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 33

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Nice table. Huge mess. Maybe this was something you created way back before you figured out tabs or a document you received from someone else. Either way, using the spacebar to separate the columns resulted in a mess. Trying to convert text to t…
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.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…

730 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