Editorial Style Sheet Macro

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=1716659834

And now, here's the macro:

'THE 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
'THE MACRO ENDS HERE

If you don't know how to use such macros, you can find out here.

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.

'THE 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
'THE MACRO ENDS HERE

If you don't know how to use such macros, you can find out here.

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!

This entry was posted in Editing. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Trackbacks

Post a Comment

You must be logged in to post a comment.

  • The Fine Print

    Thanks for reading Editorium Update (ISSN 1534-1283), published by:

    The EDITORIUM, LLC
    http://www.editorium.com

    Articles © on date of publication by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.

    You may forward copies of Editorium Update to others (but not charge for it) and print or store it for your personal use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is strictly prohibited. If you’re interested in reprinting one of our articles, please send an email message to editor@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 (you) assumes the entire risk as to the accuracy and use of this document.

    The Editorium is not affiliated with Microsoft Corporation or any other entity.

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

    If you’d like to subscribe, please enter your name and email address below. We publish the newsletter once a week, and on rare occasions we may send an important announcement. We never, ever send spam. Thank you for signing up!