Editorial Style Sheet Macro

May 12, 2004 – 12:00 pm

Last week’s newsletter provided a style sheet that editors can use to keep track of style decisions while editing in Microsoft Word. If you didn’t get that style sheet, you can download it here:

http://www.editorium.com/ftp/stylesheet.zip

Hilary Powers was kind enough to provide her StyleThat macro in last week’s newsletter, and this week I’ve adapted that macro to work with the editorial style sheet. If you select some text in a document you’re editing and then run this macro, it will switch to your editorial style sheet and paste the text under the alphabetical heading where it belongs: ABCD, EFGH, and so on. See last week’s newsletter for more information:

http://lists.topica.com/lists/editorium/read/message.html?mid=17166598 34

And now, here’s the macro:

‘MACRO STARTS HERE

Sub StyleThat()

‘Macro adapted by Hilary Powers 1/30/04; updated 4/6/04

‘Adapted by Jack M. Lyon for use with editorial style sheet

If Selection.Type = wdSelectionIP Then ‘No selection

GoTo HedBack

Else

FirstChar = Asc(Selection.Characters.First)

If FirstChar > 64 And FirstChar < 69 Then MySearch = "ABCD^p"

If FirstChar > 68 And FirstChar < 73 Then MySearch = "EFGH^p"

If FirstChar > 72 And FirstChar < 77 Then MySearch = "IJKL^p"

If FirstChar > 76 And FirstChar < 81 Then MySearch = "MNOP^p"

If FirstChar > 80 And FirstChar < 85 Then MySearch = "QRST^p"

If FirstChar > 84 And FirstChar < 91 Then MySearch = "UVWXYZ^p"

If FirstChar > 96 And FirstChar < 101 Then MySearch = "ABCD^p"

If FirstChar > 100 And FirstChar < 105 Then MySearch = "EFGH^p"

If FirstChar > 104 And FirstChar < 109 Then MySearch = "IJKL^p"

If FirstChar > 108 And FirstChar < 113 Then MySearch = "MNOP^p"

If FirstChar > 112 And FirstChar < 117 Then MySearch = "QRST^p"

If FirstChar > 116 And FirstChar < 123 Then MySearch = "UVWXYZ^p"

If FirstChar > 90 And FirstChar < 97 Then MySearch = "Comments:^p"

If FirstChar < 65 Or FirstChar > 122 Then MySearch = “Comments:^p”

Selection.Copy

WordBasic.NextWindow

WordBasic.StartOfDocument

Selection.Find.ClearFormatting

With Selection.Find

.Text = MySearch

.Forward = True

.Wrap = wdFindStop

.Format = False

.MatchCase = True

.MatchWholeWord = False

.MatchAllWordForms = False

.MatchSoundsLike = False

.MatchWildcards = False

End With

Selection.Find.Execute

Selection.MoveRight

Selection.Paste

Selection.TypeParagraph

GoTo Final

End If

HedBack:

WordBasic.NextWindow

Selection.MoveRight Unit:=wdCharacter, Count:=1

Final:

End Sub

‘MACRO ENDS HERE

If you don’t know how to use such macros, you can find out here:

http://lists.topica.com/lists/editorium/read/message.html?mid=17069228 55

And you can learn how to assign them to a hot key here:

http://www.topica.com/lists/editorium/read/message.html?mid=1713088939

Note that you don’t have to use the macro with *my* style sheet. It will work with any document in which you’ve included the following headings, each followed by a carriage return:

ABCD

EFGH

IJKL

MNOP

QRST

UVWXYZ

Comments:

_________________________________________

READERS WRITE

Last week, expert word whacker Hilary Powers sent her StyleThat macro, which I proceeded to gum up. The problem was, it didn’t want to work correctly in Word 2000; possibly some of the commands are specific to Word 2003. At any rate, here is Hilary’s macro in its pristine state, and many thanks to her for providing it.

Hilary wrote, “The macro relies on having two [and only two] files open at a time. The truly charming thing is that you can use one hot key for both chores: putting something on the style sheet and also priming the style sheet for its next use and returning to the main document.

‘MACRO STARTS HERE

Sub StyleThat()

‘ Macro adapted by Hilary Powers 1/30/04; updated 4/6/04

If Selection.Type = wdSelectionIP Then

GoTo HedBack

Else

Selection.Copy

WordBasic.NextWindow

Selection.PasteAndFormat (wdPasteDefault)

GoTo Final

End If

HedBack:

Selection.TypeParagraph

WordBasic.NextWindow

Selection.MoveRight Unit:=wdCharacter, Count:=1

Final:

End Sub

‘MACRO ENDS HERE

If you don’t know how to use such macros, you can find out here:

http://lists.topica.com/lists/editorium/read/message.html?mid=17069228 55

And you can learn how to assign them to a hot key here:

http://www.topica.com/lists/editorium/read/message.html?mid=1713088939

_________________________________________

RESOURCES

I’ve been fighting the battle against spam (junk email) but not very effectively, even though I’ve tried a couple of top-notch spam-fighting programs. Then this week I decided to try SpamArrest, and I’m thrilled to say it’s actually won the war. Boy, has my inbox been quiet.

When people send me an email message, they receive an email message in return that asks them to click a link to register themselves (a one-time operation) as someone who can send me messages. Spammers, of course, won’t bother to do this, which basically means no more spam. It’s easy to preregister family, friends, associates, and email newsletters to which I subscribe. The completely online program (no software involved) gives me complete control over how spam is handled, and it’s very easy to use.

If you’d like to know more, click here:

http://spamarrest.com/affl?1403707

And if you decide to sign up, please do so through the link above. Since I’m now a SpamArrest affiliate, your support will help keep Editorium Update alive and kicking. Thanks!

_____________________________________________________

THE FINE PRINT

Editorium Update (ISSN 1534-1283) is published by:

The EDITORIUM, LLC

Microsoft Word Add-Ins for Publishing Professionals

http://www.editorium.com

Copyright © 2008 by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.

You may forward copies of Editorium Update to yourself and others (but not charge for it) and print or store it for your own use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is prohibited. Send reprint requests to reprints [at symbol] editorium.com

Editorium Update is provided for informational purposes only and without a warranty of any kind, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and freedom from infringement. The user assumes the entire risk as to the accuracy and use of this document.

The Editorium is not affiliated with Microsoft Corporation.

_____________________________________________________

HOW TO SUBSCRIBE OR UNSUBSCRIBE

To subscribe, send a blank email message to editorium-subscribe [at symbol] topica.com.

To unsubscribe, send a blank email message to editorium-unsubscribe [at symbol] topica.com.

We do not sell, rent, or give our subscriber list to anyone.

____________________________________________________

You must be logged in to post a comment.