Solved

Highlight Rich Text Content Control

Posted on 2014-09-19
4
263 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
Comment Utility
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
Comment Utility
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 31

Assisted Solution

by:Rob Henson
Rob Henson earned 200 total points
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 …
It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
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.

771 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

11 Experts available now in Live!

Get 1:1 Help Now