THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Louis Davidson

A few Word tips and tricks for writers

Edit: Added ideas from comments at the end of the blog

Not exactly a SQL topic, but I am working on formatting a chapter from a book I am working on with a cowriter and I realized that there were a few things that I find myself doing over and over with Word that I wanted to share.  All of the tips are useful for formatting SQL in your blog posts, at the very least.

1. Shift – F3 – Applying this to a word/highlighted text in your document will cycle through the different states of capitalization.  For example, if you have:

Fred is a crazy dude.

Highlight it and press Shift-F3:

THIS IS A COOL FEATURE

Again:

this is a cool feature

And finally:

This Is A Cool Feature

If you are like me, you code everything originally in lowercase, but editors almost exclusively like the way caps look, so I find myself constantly setting keywords to caps using this feature.  I learned this in a few sessions with Microsoft Learning where the person proctoring the session was using it on the screen.  Saved me hours on the last book (you heard me, hours. I probably spent over 1000 hours writing and it might have been 2000. The book was 680 or so pages with lots of T-SQL.)

2. Get the application puretext from http://www.stevemiller.net/puretext/. This handy application will clear all formatting from text you have stored in your clipboard. Nearly every publisher has a style sheet that they require you use, and frankly if you have any Word skill at all you always use styles for titles and headings at the very least. The most annoying thing though is that the text you copy from SSMS has formatting in it, so when you paste it into your documents you have this formatting that you need to get rid of in lieu of the stuff that the publisher wants.  With Puretext you simply use a slightly different paste key (like Windows-V) and you get the plain text you need.  Same time estimate for this feature. Before I found this application I used to paste into Notepad, the copy it to the clipboard and then into Word.  Very tedious.

3. Hotkeys on styles – As mentioned in 2, nearly every publisher has a style sheet that they require you use, and frankly if you have any Word skill at all you always use styles for titles and headings at the very least.  Applying “heading 1” three or four times is no big deal, but applying code in text 1000 times in a 80 page chapter is not quite a much fun.

So, if you open up word, and find the styles ribbon (this is Word 2007, you can do much the same stuff in earlier versions, but I won’t demonstrate).  Clicking the little arrow under the Change Styles  button opens up the styles bar:

image

Now you can right click on any of the styles, choose modify to get the following:

image

Click on Format and choose Shortcut Key:

image

Once you choose a key (for the Code [ST] style I chose Alt-C. Now I highlight the term I want to make look like code and press Alt-C.  Saves tons of time.

Note: A few commenters have noted that there is a way to make this work without PureText using Word functionality (I will demonstrate the Word 2007 methods.  There are two ways:

First, when you paste text into Word 2007, you get a little menu at the end of your paste:

image

Click that and it will say:

Keep Source Formatting
Match Destination Formatting
Keep Text Only
----------------------
Set Default Paste

This would be a clumsy way to keep text many many times, but it is nice for the occasional use. More interesting is the Match Destination.  A lot of times I use text formatting to strip away some text formatting so I can reformat it.

The second is to set the default paste method.  Opening up the Word Options menu from the Office Menu you see:

image

You can set it to behave using any of the three methods mentioned by default for several scenarios, the most interesting “Pasting from other programs.” If you didn’t want to set up something like PureText, and you only used Word (I am using LiveWriter right now, and I like pasting text into here for code, but not from blogs and documents) then that would be a very viable plan too.

What it just goes to show you is that all of the Office products are freaking massive. After writing 3000 pages or so using word through the years, I consider myself an above average user, but in reality, in comparison to what features are in there, I am a novice. These are just a few tricks I have learned, the first two from others (the second was from a newsgroup posting by the author, who’s website you will find the tool), the third something I started doing on my own (didn’t come up with the idea, just found it.)  If you have other ideas, please share them here, on your blog, at conferences, etc.  Writing is a chore to start with, but formatting is a nightmare if you don’t know the tricks of the trade.

Published Sunday, January 18, 2009 12:51 AM by drsql
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Bernd Eckenfels said:

My Word 2000 and XP allow me to inser "text only" so you don't need to go via Notepad. However there is no hotkey for that, so puretext looks like a good tip. Thanks.

January 18, 2009 5:03 AM
 

Cory said:

As far as pasting text sans formatting, another few alternatives would be to a.) use Alt + E + S and select “Unformatted Text” or b.) modify the “Pasting from other programs” option in the “Cut, copy, and paste” section on the Advanced page of the Word Options dialog. Personally, I use the latter because I haven’t found a situation where I want to maintain formatting from an external app and it makes keystrokes consistent regardless of what program I’m working in.

January 18, 2009 10:15 AM
 

AaronBertrand said:

And if you write on a Mac (hey, you never know) and have a hotkey app loaded, there is a PureText equivalent called PlainClip:

http://www.bluem.net/downloads/plain-clip_en/

January 18, 2009 12:04 PM
 

Adam Machanic said:

Thanks for the heads up on PureText.  I wish I'd had this thing earlier... I'm looking forward to a vast reduction in my overall stress level when working with text from SSMS here on out!

January 18, 2009 3:26 PM
 

Arnout Grootveld said:

I love PureText, but in case I have to do without, Ctrl+Space also drops (most?) formatting from a selection in Word.

January 19, 2009 6:44 AM
 

drsql said:

Arnout, sweet tip. It seems that it makes all of the text fit the selected format...Very sweet.

January 19, 2009 11:11 AM
 

Paul Nielsen said:

Ctrl-Space removes all non-style font changes and Ctrl-Q removes all non-style para changes.

February 26, 2009 1:05 AM

Leave a Comment

(required) 
(required) 
Submit

This Blog

Syndication

Links to my other sites

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement