Micro Fix for Macro Formatting Troubles

As an Information Developer, your work usually starts with opening an authoring tool of choice, creating a template and styles, writing the content, and producing a piece of consistent writing.

Well, most of the time. This applies to some 80–90 % of your time when you’re not busy digging information and interviewing SMEs. One of the things that you might be requested to do in your spare 10 % of time is to proofread some internal company or project documents. Usually, the process of proofreading involves Word documents and dealing with the following aspects:

  • Spelling and grammar errors
  • Naming conventions
  • Formatting
  • Overall structure and the level of details

A good spellchecker will save you the trouble of having to fix absolutely all spelling and grammar errors. There’s no proper artificial intelligence out there yet, so no one can handle structure and the level of details for you. But what do you do with formatting and naming conventions?

Fixing formatting and naming conventions: the manual approach

Doing everything manually is one way to go. Let’s consider an example here.

Your task is to proofread release notes for one of the company’s products. The release notes are autogenerated from Bugzilla. For each bug, what you get to deal with basically looks as follows:

Formatting Before

Let’s examine this sample closer:

  • The names need a bit of cleaning up: “J SMITH” should be “John Smith” and “J Doe” should be “John Doe”.
  • Tabs should be replaced with single spaces.
  • Soft breaks should be replaced with hard breaks.
  • Extra closing parentheses at the end of some lines should be removed.
  • “Sign off Contact” should be “Sign-off contact”, “Assigned To” should actually be “Assigned to”, and “Reported By” should be “Reported by”.
  • The “Assigned To” line is missing a semicolon.

After the cleanup, the bug description will look as follows:

Formatting After

You are probably going to spend around 1–2 minutes to fix this sample manually. What if your release notes include 100 bug descriptions? And you receive them once a fortnight? Math says that we end up with some 100–200 minutes of mundane find-and-replace copy-and-paste work at a time. Quite a lot, right? And we’re not even on the scale of months or years. All this precious time that could be dedicated to some value-added work like working out the appropriate structure and adding the relevant details.

Fixing formatting and naming conventions: the macro approach

A good choice for such formatting issues is the use of macros. Basically, a macro does the same thing that you do: for example, find soft breaks, and then replace each with a hard break. The underlying difference here is that it all occurs automatically, all at once, within seconds. All you are required to do is create the needed macros once, and then apply them to the documents whenever needed. A handy thing is that you can save the macros in a separate template or create a separate button on the Quick Access Toolbar for the ones that you use frequently.

How do you create a macro?

Two ways here:

  • Record a macro – This process is similar to screencasting: you open a Word document and perform all actions of your procedure (find and replace soft breaks), while Word records and saves them for future use. After that, it’s a one-click effort for you to apply the macro.
    Record Macro
    A good starting point here is MS Office support portal and a variety of screencasts on YouTube.
  • Write a macro – This one requires getting familiar with Visual Basic, a programming language built into the MS Office Suite (by the way, you can apply macros and automate your tasks in Excel and PowerPoint as well). This approach can produce a lot more sophisticated macros, but it requires some dirty work and behind-the-scenes tweaking of Visual Basic code. Good news is there are a lot of ready macros on the web, which you can reference or reuse in your docs.
    For you to get an idea of Visual Basic, the following screenshot shows a very simple macro for replacing soft breaks.
    Write Macro.png

Where to go next?

For simple find-and-replace and copy-and-paste tasks that take a lot of time and don’t require serious rocket-science pondering, the macros definitely do the trick. If you are new to this, you’ll get the hang of recording and applying simple macros within a couple of hours or less.

After you feel confident with such simple macros, you may consider more intriguing tricks like automatically applying styles using macros, or even creating custom user hints. This requires a bit of digging into Visual Basic, but it definitely pays off if you’re dealing with Word documents on a regular basis.

Advertisements

2 thoughts on “Micro Fix for Macro Formatting Troubles

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s