Archive for July, 2011

h1

Word: Macro to change first letter after a colon to upper case

July 18, 2011

Scenario

You have a Word document where one or more authors have variously used upper and lower case for the first letter of the first word after a colon (e.g. Note: This… and Note: this… ). For consistency and compliance with your style guide, you want to capitalize every initial letter immediately following a colon.

Solution

Run a macro to make the first letter after a colon a capital letter.

The critical parts of this find/replace macro are:

  • .Text = “: ([a-z])” — Word looks for a colon followed by a space, then a wildcard command for any lower case letter
  • .MatchWildcards = True — Word treats the .Text values in the parentheses as a wildcard string
  • Selection.Range.Case = wdUpperCase — When a lower case letter after a colon and a space is found, Word changes it to upper case.

Macro to capitalize the first letter after a colon

Sub CapsAfterColon()
    With Selection.Find
        .ClearFormatting
        .Text = ": ([a-z])"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = True
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute
        While .Found
            Selection.Range.Case = wdUpperCase
            Selection.Collapse Direction:=wdCollapseEnd
            .Execute
        Wend
    End With
End Sub

Other options

If always you want the first letter after a colon and space to be in lower case, make these changes to this macro:

  • .Text = “: ([A-Z])” — Word looks for a colon followed by a space, then a wildcard command for any upper case letter
  • Selection.Range.Case = wdLowerCase — When an upper case letter after a colon and a space is found, Word changes it to lower case.

If a macro is too scary for you, you can partially run this as a Find/Replace action. Type : ([a-z]) in the Find field, click More and select Match Wildcards, then click Find Next to find the first instance. You can then change each found word’s initial letter to upper case, one at a time.

[Links last checked June 2011; this macro is a modification of one from Allen Wyatt’s Word VBA Guidebook (http://store.tips.net/T010353_Word_VBA_Guidebook_Table_of_Contents.html)]

h1

Firefox: Organize bookmarks

July 15, 2011

In Firefox 5.x, the Organize Bookmarks option has gone — it’s been replaced with Show All Bookmarks.

To see the complete list of your bookmarks so that you can arrange them into folders, import/export them etc., go to Bookmarks > Show All Bookmarks.

Organize your Firefox BookmarksI’m not sure why they changed the name — Organize Bookmarks worked well for me. My first thought on seeing Show All Bookmarks was that everything I had bookmarked would open in new tabs!

h1

Word: Change the case of the first letter of each bullet list item

July 14, 2011

Colette, one of my authors, asked if there was a way to stop Word automatically capitalizing the first word of each item in a bulleted list. Our style guide is to NOT capitalize list items when they are part of the stem sentence; for example, we DON’T capitalize a list like this:

At the grocery store, she purchased:

  • apples
  • oranges
  • pears
  • bacon
  • detergent.

We DO capitalize items in a list where one or more items are a complete sentence.

The problem with Word is that it’s all or nothing. The only option you can set is to let Word capitalize the first word of every sentence (the default) or not (in Word 2007: Word Options  Proofing > AutoCorrect button.)

You can’t specify a different setting for bulleted or numbered lists. As a result, typing a new bullet list item changes the first letter to upper case, even if you want lower case (see the see also list below for an alternative). And it’s a nuisance to have to correct them one at a time.

But there’s a trick you can use to convert the first letter of each item in a bulleted list to lower case. I first wrote about it in 2004, but it’s worth repeating as it’s a clever thing you can do.

You hold down the Alt key as you drag the mouse over the bullets and just the first letters of each item. This selects just that text. Then you press Shift+F3 to convert the upper case letters to lower case.

Hold down ALT and drag carefully to select just the first letters

Hold down ALT and drag carefully to select just the first letters

Neat, huh?

See also:

[Links last checked July 2011]

h1

Word: Macro to show all formatting on opening a document

July 13, 2011

I’ve written before about using a macro to show all formatting marks, bookmarks, table grid lines and field shading before, and just yesterday I gave you a macro for turning off the track formatting option in Track Changes. The problem is that these macros require user input to run.

So what if you find these options pretty clever and want to include them in your template so that every time you opened a document based on that template, they’d automatically run and the author wouldn’t have to remember to run them? For that you need to add them to the AutoOpen() macro.

AutoOpen and AutoNew macros are inbuilt into Word, and anything you include in them is automatically run whenever you open a document (AutoOpen) or create a new document (AutoNew) based on the template.

Here’s how to incorporate the two macros above into an AutoOpen() macro:

Sub AutoOpen()

' macro to display bookmarks, field shading, formatting marks, _
table grid lines and turn off Track Formatting in Track Changes _
on opening an existing document based on the template 

With ActiveWindow.View
   .ShowAll = True
   .ShowBookmarks = True
   .FieldShading = wdFieldShadingAlways
  If ActiveDocument.ActiveWindow.View.TableGridlines = False Then
     ActiveDocument.ActiveWindow.View.TableGridlines = True
  End If
End With

With ActiveDocument
   .TrackFormatting = False
End With

End Sub

[Links last checked July 2011]

h1

Word: Macro to turn off Track Formatting

July 12, 2011

If you use Track Changes a lot — as my authors and their reviewers do — then you may find that formatting changes are often tracked, along with insertions and deletions. I think that the Track Formatting setting travels with the document — I have my setting turned off, but I’ll often get documents that have it turned on and I have to turn it off again, so it doesn’t appear to be computer-specific, just document-specific.

Sure, you can turn off the Track Formatting option in the Track Changes settings (Word 2007 and later), but this won’t accept those changes already tracked — it just prevents the tracking of future formatting changes. You can also accept just the formatting changes. But both these methods require you to take action.

But what if you want to turn off that setting automatically for any document that you create or open? You can, if you add this to any AutoNew() (applies setting to new documents on creation) and/or AutoOpen() (applies setting to existing document on opening) macro in your template, or in a separate macros document that applies to all documents:

With ActiveDocument

    .TrackFormatting = False

End With

So, if you don’t already have an AutoOpen() macro, then the complete macro would look like this (AutoNew() is the same — just copy and paste this macro and replace AutoOpen with AutoNew):

Sub AutoOpen()

   With ActiveDocument

      .TrackFormatting = False

   End With

End Sub

[Links last checked July 2011]

h1

Firefox: Get back your list of recent pages

July 11, 2011

It seems that in Firefox 4.x and later, Mozilla got rid of the little drop-down icon that was next to the Forward and Back buttons that showed you the path of web pages you viewed to get to the current page.This is NOT the same as your History.

This was a really handy and useful feature and one I used often. My husband used it often too, so when we upgraded his Firefox to version 5.x, he complained about its removal.

So, I went looking to see what had happened to it and whether I could get it back. Well, there are some Firefox add-ons that return it to your browser interface, but to be honest, the quickest and easiest way to see your path to the current page is one of these two methods:

  • right-click on the Back button

OR

  • hold down the primary mouse button as you click on the Back button.

It’s a slight change in behavior, but one that will show your path to the current page.

I still don’t know why they got rid of the icon.

Show the page path by right-clicking the Back button or holding down the mouse as you click it

Show the page path by right-clicking the Back button or holding down the mouse as you click it

h1

Some days editing is a challenge

July 8, 2011

Try this paragraph I had in a document the other day:

Therefore, the unlooped trunkline alternative will be reviewed only as a sensitivity comparing unlooped versus looped trunkline configuration on a mid case value, recovery and campaign timing basis only.

I couldn’t make any sense of it, even after reading it several times and putting in punctuation… I sent it back to the author with a comment about splitting into two sentences, explaining or expanding the terms, removing a second ‘only’, adding/removing words, and just rewording the darned thing!

Follow

Get every new post delivered to your Inbox.

Join 432 other followers