4

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

0

2 Answers 2

2

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

1
  • Hi Otaku. Sorry for the late response, I asked the question a while ago and ended up coming at the problem from another angle. However, your response is very useful and I will keep it saved for whenever I have to do this sort of thing again. VBA is really not my strong suit, haha :). Thanks very much for taking the time to respond to my question, very much appreciated. - Iain Feb 15, 2010 at 0:04
0

I think you could write a macro that removed tools from the toolbar, menus, maybe even keyboard shortcuts. Not sure how you'd reverse it though when they opened another document.

Maybe a better solution is to use an application to edit only certain text fields that you define and which ultimately change text in a word document?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.