I’m working for a small company these days and have really been enjoying it. This position is much more of a generalist role and less working on specific customizations, or projects to really push the envelope of a system or process. (Shh.. Don’t tell Bill but they have these things here called Ubuntu Servers) I don’t mind the generalist role in the least, it’s a great time to really introduce some cool features to folks who may never see them. So, one day our HR manager came to me and asked me why spell check wasn’t working in this form enabled document. I said let me take a look.
As we know once you protect the document, which they’ve done it locks down many features, Spelling and Grammar being one of them. Mind you, I’m a systems guy, I build infrastructure and servers, occasionally I do some work with SharePoint but I rarely do any custom work or anything that would be considered custom. I’m an Out of the Box type fella. I also remember templates at my last company. I managed the web interface for them but not the actual templates. I clearly remember the pain on the faces of my co-workers when a request came in to edit or change a template. Not to mention the move from Office 2003 to Office 2010, that was really bad. So I thought long and hard about my reply… I could put a button there… Oh I should have just said once protected….
Back to the issue. I started digging around and found a great online reference to spellchecking a protected document. You can read about it here: http://word.mvps.org/ actual link: How to enable spellchecker in a protected document. The site is a little dated but the information is spot on. It was quite the cut and paste deal and really simple to pull off, the password challenge was unique but if I would have actually read the document it would have been fine. You just have to make a minor code modification to allow for the password to unprotect and then protect the document. The trick for me was, how does the general user run the macro?
Right, so after putting this macro in an Office 2010 document the end user has to click on the ‘view’ tab, then ‘macros’, then ‘view macros’, and then know which (If you have more than one) macro to run? What if one of the macros was ‘clear form’ instead of spell check? Ouch.. So I wanted a button, or a tab, or something to make the user experience to be much easier.
The above reference does have an option to show you how to replace the button, but its working with Office 2003 or older and outdated for my slick install of 2010. I started hunting around and came to a few sites that mostly put it together. I found this site: Greg Maxey (Look at the cute graphic, he must be a developer) you’ll need the Custom UI Editor Tool. And away we go..
First you have your document, TestDoc.doc. We’ll need to change it to a macro enabled document or template so now its testdoc.docm. This document has a form that the user will fill out. Its also protected to allow for form fill in.
Add your macro.. Now lets add a button.
Download and install the above mentioned Custom UI Editor for Microsoft office. Open this and then open your document then right click and select ‘Office 2010 Custom UI Part’.
You’ll then see a child ‘customUI14.xml appear. This is the magical part! This is where you can edit the UI on the ribbon and other areas of your MS Office experience. This is also where things get rather fuzzy for me as a non-developer. Luckily someone thought of me when writing this and included some of the simple/common things that you may want to do.
I selected ‘Custom Tab’ and Cachow in pops some really fancy looking XML. I made a few edits and saved it to the document.
Something to note: If your editing for Office 2007 the xmlsns line is slightly different. It should be : <customUI xmlns=http://schemas.microsoft.com/office/2006/01/customui>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Snazzy TAB">
<group id="customGroup" label="Snazzy Group">
<button id="customButton" label="Snazzy Button" imageMso="HappyFace" size="large" onAction="SPC" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
I get this:
Pretty cool right? But if you click the button you get nothing but an error. Even though its calling my Macro (onAction=”
SPC” its not quite hooked up! I had some digging to do to find out where the error was. I tried “SPC()”, a different name, a different macro, a different document, a different computer (no, not really) but I tried a lot of things. I was looking over the macro and noticed that the code ‘Sub SPC()’ looked different than one of the examples and I found my issue.
You need to run the macro ‘Sub SPC(control As IRibbonControl)’ The control Represents the active window containing the Ribbon user interface that triggers a callback procedure. But it works, and that’s all that matters.
So the moral of this story is that we now have an HR document that allows the end user (in this case highly skilled Attorneys) to use spell check when they fill out their performance review forms!!
Now, if they only had SharePoint I would have InfoPath’ed a new form and built some workflows around this developed a complete process and they would have passed out! But for a small company SharePoint seems expensive! ![]()

Whew, what a great resource. I needed that bit about ‘control As IRibbonControl’