tags:

views:

26

answers:

2

We want to disable any and all formatting and insertion commands in Word except for bold and italic in all documents that are created from a certain template. It should not be possible to change styles, insert anything but text, or change character formatting at all (except for the aforementioned bold and italic formats). Is there a way to achieve this?

Maybe it would be possible to disable these commands with a VBA autostart macro in the template?

+1  A: 

Hello. The only way would be to hook the WindowSelectionChange(ByVal Sel As Selection) event and catch any change that is not a character, bold format or italic format. I guess it would be a fair amount of coding to set this up.

Mahin
A: 

I figured out how to do this with RibbonX. For example, to disable the bold command, add this RibbonX XML to the document or template:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"&gt;
    <commands>
        <command idMso="Bold" enabled="false"/>
    </commands>
</customUI>

Of course, the user can still paste bold text.

Markus Roth
Unfortunately, that just hides the problem a little, it doesn't stop it. Not only can a user paste bold text, they can format via the keyboard by selecting something and the typing Ctrl+B.
Otaku

related questions