First of all I’m going to state right out that I’ve never worked with VB in the context of coding macros before – my skills lie in other areas (PHP, Javascript, getting there with C#, etc). However, I’ve been asked by a colleague to lock down a document so that the user cannot change font faces, sizes or colours but does still have access to bold, italic, underline etc.
I started out by protecting the document and restricting formatting but this is far too restrictive – effectively only allowing the user to apply premade styles – which is going to be unintuitive for the users who are not used to working with styles.
So I’ve resorted to trying to writing a macro to do the job, but unfortunately I’m at the really pointy end of the learning curve and I honestly don’t know where to start.
You’re going to laugh at me but so far this is all I have in my ThisDocument.
Private Sub Document_Open()
End Sub
Ermmmm… help!
Cheers
Iain
Iain, this is a pretty common need. Here’s a good information page on what will get you started: Using VBA to Control Built-In Commands in the 2007 Office System