Home

How to Spike Text in Word 2016

|
Updated:  
2016-11-16 2:50:59
|
Word 2010 For Dummies
Explore Book
Buy On Amazon
When you're writing in Word 2016, especially if you're working on an academic paper or even a large fiction work, you might want to spike large chunks of text rather than delete them. To spike text, you select it and then move it down to the end of the document. When you're "done" writing, review your spikes to see whether anything is worth saving.

Following is code for a spike_text macro that automates the process:

Sub spike_text() ' ' spike_text Macro ' Move selected text to the end of the document ' If Selection.Type = wdSelectionNormal Then Selection.Cut Selection.EndKey Unit:=wdStory Selection.TypeParagraph

Selection.Paste Application.GoBack Application.GoBack Else MsgBox "Nothing to spike" End If End Sub

This macro contains an if-else structure. The if test determines whether text is selected. If so, the text is cut and pasted at the end of the document. When text isn't selected, the else part of the equation displays a message box with the text "Nothing to spike."

This macro was recorded initially and used these keystrokes:

  1. Ctrl+X
  2. Ctrl+End
  3. Ctrl+V
  4. Shift+F5, Shift+F5 The Shift+F5 keyboard shortcut returns you to the previous editing location in the document.
After recording the keystrokes, the if-else structure was added to ensure that the macro didn't display an ugly error message when text isn't selected. This process is part of defensive programming, where you anticipate that not every macro starts under ideal conditions. In this instance, a non-ideal condition is when text isn't selected.

About This Article

This article is from the book: 

About the book author:

Dan Gookin has been writing about technology for 20 years. He has contributed articles to numerous high-tech magazines and written more than 90 books about personal computing technology, many of them accurate.
He combines his love of writing with his interest in technology to create books that are informative and entertaining, but not boring. Having sold more than 14 million titles translated into more than 30 languages, Dan can attest that his method of crafting computer tomes does seem to work.
Perhaps Dan’s most famous title is the original DOS For Dummies, published in 1991. It became the world’s fastest-selling computer book, at one time moving more copies per week than the New York Times number-one best seller (although, because it’s a reference book, it could not be listed on the NYT best seller list). That book spawned the entire line of For Dummies books, which remains a publishing phenomenon to this day.
Dan’s most recent titles include PCs For Dummies, 9th Edition; Buying a Computer For Dummies, 2005 Edition; Troubleshooting Your PC For Dummies; Dan Gookin’s Naked Windows XP; and Dan Gookin’s Naked Office. He publishes a free weekly computer newsletter, “Weekly Wambooli Salad,” and also maintains the vast and helpful Web site www.wambooli.com.