Warning this article may contain opinions of the author that you and iTWire don't necessarily agree with. Don't let them get away with it - have your say with a comment!

No. 1 Story

HP job cuts loom for Australian employees

A number of Australian employees of Hewlett-Packard are facing the loss of their jobs as the global computer giant looks to slash its worldwide workforce by up to 30,000.

read more

Replacing styles in Word 2008

Opinion and Analysis

AppleScript can be a very useful tool for automating applications or coupling two or more programs so they work together. But sometimes it is more trouble than is necessary to achieve a particular result.

David Pogue's New York Times blog is generally good reading, but I think he recently led readers down the garden path. Last Friday, he published a pair of AppleScripts for use with Microsoft
Word 2008.

The first turns hard-wrapped text (perhaps pasted from an email) into ordinary wrapping paragraphs. No problem there - it's a useful function.

But the second merely duplicates a function already provided by a Word command.

The idea is that you sometimes need to change styles en masse, for example if a document's author used heading style Level1, where you prefer your own Head1.

The script, which originated with Microsoft, is in my opinion harder to use that the program's built-in search-and-replace command, as the style names are hard-coded into the script.

This is how to change every occurrence of one style in a Word document into a different style.

Choose Replace from the Edit menu.

Without clicking anywhere else in the Find and Replace dialog, select Style from the Format popup menu in the lower section of the dialog. A new window labelled Find Style opens - select the name of the existing style from the list, and click OK.

Now click in the Replace with: field, then once again select Style from the Format popup menu in the lower section of the dialog. Find Style opens - select the name of the replacement style from the list, and click OK.

Making sure you have left both the Find what: and Replace with: fields empty, click Replace All.

In my opinion, that's hardly more difficult than replacing one string with another, showing the task doesn't really require a script.

That said, the script from Pogue's blog would serve as a useful starting point if you regularly need change the formatting of documents from one set of styles to another.