Page Down in Synch

Working on an index this week, I needed to ensure that pagination of the document I was indexing matched another document in which pagination had already been set. Because of the complexity of the material, I had to do this manually and visually, paging down in document 1, switching to document 2, paging down again, and then switching back to document 1. What a pain! It wasn't long before I found myself writing a macro to move down a page in both documents at once. Here it is, short but sweet:

'THE MACRO STARTS HERE
Sub PageDownInSynch()
Documents(2).Activate
Selection.GoTo What:=wdGoToPage
Documents(1).Activate
Selection.GoTo What:=wdGoToPage
End Sub
'THE MACRO ENDS HERE

If you don't know how to use macros like that one, you can learn how here:

For the macro to work, you must have two documents open in Word at the same time, and the process works best if you've sized and arranged the two documents vertically side by side. (Our Editor's ToolKit program includes an "Arrange Documents" macro that will do that for you instantly and automatically.)

For best results, assign the macro to a keyboard combination so you can quickly run it over and over with the touch of a key. You can learn how to do that here:

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

Now you can page through your documents, adjusting pagination as needed with manual page breaks (CTRL + ENTER). You'll probably find other uses for the macro as well. Enjoy!

_________________________________________

READERS WRITE

William T. Buckley wrote, "This is not a huge issue, but it does come up once in a while, especially in limited-space conditions. How do I produce a circled-c 'circa' sign or symbol, not to be confused with a (c) copyright symbol? I've looked at several grids and character maps, and don't find anything like what I need."

I was unable to find such a character, even in Unicode fonts. Do you, gentle reader, have an answer?

Preston Earle wrote, "Thanks for the improved Title Case macro. Is there a way to modify the macro such that it ignores a list of all-caps words like USA, NASA, MS (as in MS Word), and, perhaps, state abbreviations?"

I've now modified the macro to do this. Here's the new version:


'MACRO BEGINS HERE
Sub TitleCaseHeadings()
'Created by Jack M. Lyon
'
For h = 1 To 9
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
myHeading$ = "Heading" + Str(h)
Selection.Find.Style = ActiveDocument.Styles(myHeading$)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
For Each wrd In Selection.Range.Words
Select Case Trim(wrd)
Case "A", "An", "As", "At", "And", "But", _
"By", "For", "From", "In", "Into", "Of", _
"On", "Or", "Over", "The", "Through", _
"To", "Under", "Unto", "With"
wrd.Case = wdLowerCase
Case "Usa", "Nasa", "Usda", "Ibm", "Nato"
wrd.Case = wdUpperCase   End Select
Next wrd
wrdCount = Selection.Range.Words.Count
Selection.Range.Words(1).Case = wdTitleWord
Selection.Range.Words(wrdCount - 1).Case = wdTitleWord
strLength = Selection.Range.Characters.Count
For i = 1 To strLength
If Selection.Range.Characters(i) = ":" Then
Selection.Range.Characters(i + 2).Case = wdTitleWord
End If
Next i
Selection.Find.Execute
Wend
Next h
MsgBox "Finished!", , "Title Case Headings"
End Sub
'MACRO ENDS HERE

The line that makes the difference is this one:


Case "Usa", "Nasa", "Usda", "Ibm", "Nato"

Feel free to modify that line to suit your needs. The items I've included are just examples. Notice, though, that for the macro to work, you must type your items not in all caps (USA) but in title case (Usa). That's because the macro has already put the whole *line* in title case, so you're now specifying words in title case that you want to be in all caps.

Many thanks for the help, questions, and suggestions.

_________________________________________

RESOURCES

SoftSnow offers some very interesting software that may come in handy if you're involved in electronic publishing or converting documents to HTML. Book Proofer and HTML Book Fixer look especially interesting:

http://www.softsnow.biz/index.shtml

Title Case Macro, Version 2

Last week's newsletter featured a macro to change all-cap headings into title case. It had some drawbacks, though. It would do only one heading level at a time, and you had to specify which heading level you wanted it to work on. In addition, it didn't lowercase articles, prepositions, and conjunctions. What's really needed is a macro that will cycle through *all* of your heading levels (any paragraph styled with one of Word's Heading paragraph styles, such as Heading 1), make them title case, and lowercase articles, prepositions, and conjunctions unless they occur at the beginning or end of the heading. Oh, and one more thing: It should capitalize any word following a colon and a space. I'm giving away the store here, but here's the macro, which I hope you'll find useful:


'MACRO BEGINS HERE
Sub TitleCaseHeadings()
'Created by Jack M. Lyon
'http://www.editorium.com
For h = 1 To 9
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
myHeading$ = "Heading" + Str(h)
Selection.Find.Style = ActiveDocument.Styles(myHeading$)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
For Each wrd In Selection.Range.Words
Select Case Trim(wrd)
Case "A", "An", "As", "At", "And", "But", _
"By", "For", "From", "In", "Into", "Of", _
"On", "Or", "Over", "The", "Through", _
"To", "Under", "Unto", "With"
wrd.Case = wdLowerCase
End Select
Next wrd
wrdCount = Selection.Range.Words.Count
Selection.Range.Words(1).Case = wdTitleWord
Selection.Range.Words(wrdCount - 1).Case = wdTitleWord
strLength = Selection.Range.Characters.Count
For i = 1 To strLength
If Selection.Range.Characters(i) = ":" Then
Selection.Range.Characters(i + 2).Case = wdTitleWord
End If
Next i
Selection.Find.Execute
Wend
Next h
MsgBox "Finished!", , "Title Case Headings"
End Sub
'MACRO ENDS HERE

If you don't know how to use macros like that one, you can learn how here.

If you're wondering why you'd want to use a macro like that one, please see my article "The Case against Caps":

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

Please note that you can modify the macro to specify the words you want to be lowercased. Here are the lines you'll need to change:

Case "A", "An", "As", "At", "And", "But", _

"By", "For", "From", "In", "Into", "Of", _

"On", "Or", "Over", "The", "Through", _

"To", "Under", "Unto", "With"

For example, if you wanted to add "Throughout," the modified lines might look like this:

Case "A", "An", "As", "At", "And", "But", _

"By", "For", "From", "In", "Into", "Of", _

"On", "Or", "Over", "The", "Through", _

"To", "Under", "Unto", "With", "Throughout"

You can also delete words. For example, if you wanted to delete "As," the modified lines would look like this:

Case "A", "An", "At", "And", "But", _

"By", "For", "From", "In", "Into", "Of", _

"On", "Or", "Over", "The", "Through", _

"To", "Under", "Unto", "With"

Don't worry about getting the lines too long. You won't. The lowlines _ at the end of each line just break up the macro for easy reading. You can delete them and the following paragraph returns to merge the four lines if you want to.

By the way, you don't have to reserve the macro for changing headings in all caps. You can use it on any headings that need to be changed to true title case. This does not, however, excuse you from editing your headings.

Thanks to Hilary Powers for suggesting the improvements.

_________________________________________

READERS WRITE

Peg Wier wrote:

I agree with you on all counts about the formatting of headings with all caps. I think you left out the most important case against all caps--THEY ARE HARD TO READ!

Bruce White wrote about converting Word documents to HTML:

There are a whole bunch of tools that grew from WinHelp tools. Reworx grew out of HDK by Virtual Media. See the Republicorp website:

Instead of cleaning up Word HTML what you do is get the tool to generate the code from the Word document. It breaks the document into separate HTML pages based on the heading styles in the document. It will preserve the index entries, the links and especially the outline structure (levels of headings--which you can use it in a TOC if you want).

OR the pages can be passed to Dreamweaver and maintained there.

Many thanks for the help and suggestions.

_________________________________________

RESOURCES

Ever heard of a candrabindu? Want to know the difference between oblique and inclined? You can learn all kinds of interesting things from the Encyclopedia of Typography and Electronic Communication:

http://ourworld.compuserve.com/homepages/profirst/encycl2.htm#index

Title Case Macro

During my other life as a copyeditor, I often find myself needing to change the case of words that an author has typed in all caps, LIKE THIS, in chapter titles and subheads. I often perform the task with the handy Cap Title Case feature in my Editor's ToolKit program, but I've also wished for a macro that would do most of the dirty work automatically throughout a document without having to select text. So, I decided to write one. Here it is:


'MACRO BEGINS HERE
Sub FixCaps()
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 1")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Find.Execute
Wend
MsgBox "Finished!", , "Fix Caps"
End Sub
'MACRO ENDS HERE

If you don't know how to use macros like that one, you can learn how here.

The macro goes through your document finding any words formatted with the Heading 1 paragraph style and changes them to title case. Of course, you'll still need to lowercase articles, prepositions, and conjunctions by hand, but at least the macro keeps you from having to change *everything* by hand.

If you're wondering why you'd want to change all caps to title case, please see my article "The Case against Caps":

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

Worried about all caps in other heading styles? You can modify the macro to find them by changing this line:

Selection.Find.Style = ActiveDocument.Styles("Heading 1")

For example, if I wanted to find text formatted with Heading 2 rather than Heading 1, I would change the line to this:

Selection.Find.Style = ActiveDocument.Styles("Heading 2")

You can also modify the case the macro will use to change the text it finds. Currently, it makes words title case, as specified in the following line:

Selection.Range.Case = wdTitleWord

Rather than using "wdTitleWord" (title case), however, you can use the following, if you prefer:

wdLowerCase (which formats the words in lower case).

wdTitleSentence (Which formats the words in sentence case).

Now the next time you need to change the case of a bunch of all-cap headings, you'll have an easy way to get the job done.

You can learn about Editor's ToolKit here:

http://www.editorium.com/14857.htm

_________________________________________

READERS WRITE

Last week Brad Hurley asked for help in cleaning up HTML from Word, and in particular copying the text of a Word document and pasting it into a Dreamweaver page while preserving basic text formatting (headings and any bold or italic body text) and hyperlinks that were created in the Word document.

Keith Soltys responded:

Your reader who wants to be able to get Word into Dreamweaver might want to take a look at the YAWC Pro plugin for Word:

http://www.yawcpro.com/

According to their web site:

"YAWC Pro generates HTML which is much cleaner and smaller than that generated by MS-Word itself. It also places the content of the Word document into a pre-defined HTML template, so that the output HTML is ready for immediate publication on a website. YAWC Pro avoids the need for post-conversion clean-up of HTML documents, and avoids the need for most content creators to have anything but the most basic knowledge of HTML."

It also can generate XML.

Looks like an interesting tool, but I haven't tried it so I can't offer an opinion on how successful it is.

As far as being able to just copy and paste into Dreamweaver, I don't think there's any way he's going to be able to do it without an intermediate conversion first.

Gaston Brisbois suggested using converters from Logictran:

http://www.logictran.net/products/

http://www.bykeyword.com/pages/detail7/download-7337.html

Cecelia Munzenmaier wrote:

Dreamweaver MX has an Import option that will automatically clean up Word HTML, as well as a separate "Clean Up Word HTML" command. If that's not heavy-duty enough, there's also Word Cleaner; I have no personal knowledge of it, but there's a description here:

http://www.wordcleaner.com/dreamweaver_details.htm

LeAnne Baird wrote:

I'd recommend looking at WebWorks Publisher for Word by Quadralay. With it you can map styles in Word to web styles and control how the formatting is changed on the web side. It's really slick once you get your their standard template customized for your look and feel.

You don't even have to cut and paste. Just run the WebWorks conversion utility on your file and you're done.

http://www.webworks.com/products/wwpp_w/default.aspx

Many thanks to all for their help and suggestions.