Word VBA tips

Friday, June 1st, 2012 | Microsoft Office 2010 | Mike Smith

There are many law firms and businesses that utilize VBA in their Word templates for user forms or automation.  This post will show you some tips for using VBA in your templates.

 

1 – Protect your code!

The most important part of VBA coding is to protect your work.  This can be from [advanced] users trying to edit the code or others trying copy it. To put a password on your code, follow these steps:

- open the visual basic editor (from the developer bar) in Word

- right-click the project you want to add a password

- open the “protection” tab

- enable the “lock project for viewing” and enter a password in the boxes below

 

2 – Make Revisions

This part should go without saying. If you are working on a complicated code for a project, make sure you keep incremental copies of your code with notes about its functionality.  This can be very helpful if you need to retrace your steps or you end up coding in a direction that doesn’t work.

 

3 – Testing and Training

When you are ready for users to test their code, make sure they are properly trained on how it should function.  Then roll the new code out to a test group before deploying to the whole office

 

4 – Sign your code

You can digitally sign your code with either a CA certificate or a self signed certificate.  Depending on how your firm’s Office is configured, you may only be allowed to run code that is signed, thus you would want to create code that will comply.  To create a self signed VBA project, follow these steps:

- From the state menu, navigate to “Microsoft Office -> Microsoft Office Tools -> Digital Certificate for VBA Projects”

- Enter your company’s name

- Click okay and close the utility

- Open your VBA project from Word, then open the “Tools -> Digital Signature” menu.  There should be the option to select the certificate you just created

Tags: , , , ,

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Page 1 of 11

Leave a Reply