How to Spike Text in Word 2016
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:
' spike_text Macro
' Move selected text to the end of the document
If Selection.Type = wdSelectionNormal Then
MsgBox "Nothing to spike"
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:
- 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.