From: Greg Maxey on
I can identify ContentControl schema violations with the "red dashed box"
visual indicator. Does anyone know how to count those boxes or otherwise
determine if one or more CC schema violations appear in a document?

I am trying to create functional CC validation process. The schema
validation method works great, but it has no teeth so to speak. All it does
is flag the violations. If I could somehow count those violations then I
could prevent a user from doing things like save, print, etc until valid
entries are present.

There is a property:

MsgBox ActiveDocument.XMLSchemaViolations.Count

This counts document schema violation, but this doesn't detect violations in
Content Controls.

I tried adding the CustomXMLPart XML element tags to the contents of the
ContentControls, but doing this causes a schema violation in the document
even if the data in the CC is correct. I really don't know that much about
XML so I could be applying the tags incorrectly.

Thanks for your interest and replies.



--
Greg Maxey

See my web site http://gregmaxey.mvps.org
for an eclectic collection of Word Tips.