In a writing sprint or Pomodoro sequence, we just want to keep writing, so a setting detail or character quirk shouldn’t force us to slow down unnecessarily.
Enter novel notes ... and with macros you can quickly insert a note, perhaps even based on the novel context, and move on with your writing.
There is a lot of room for personal preferences based on the placement, wording, context, or styles of your notes; so the extended content includes a couple options. Other articles may expand on these ideas later.
Thanks for your interest
This content is part of a paid plan.
Create the empty macro
A previous post covers creating an empty macro like the one shown below. When you’re done, you’ll have something like:
The single quote tells VBA the rest of the text on that line is a comment meant for human readers. We start our macro steps on the empty line.
What are the manual steps?
I’ll quickly insert a note in a new paragraph above where I’m writing without having to move back and forth in the document.
What steps would we use to add a new novel note paragraph manually?
There are several ways to accomplish this, but we'll take a direct route here.
- Select and copy any relevant text for the note
- Move to the beginning of the paragraph
- Insert the new paragraph
- Type your note and paste any selected text
- Move back to the original editing location
A standard Word keyboard shortcut exists to move up a paragraph in Word (Control+Up in Windows or Command+Up Arrow on a Mac), so that helps a little, but it’s still a lot of steps especially if we insert the note often.
A couple text selection options will be handled in the extended content below.
Use Ranges
We would like to leave the insertion point in place when we insert the note, so we can just keep writing. Using Ranges is probably the easiest way to make our changes.
A Range is basically a span of text in the document. Much like an invisible Selection, we can move or change it as well as delete and modify any text. See this previous article on a brief introduction to Ranges.
Insert a note in a paragraph
Store the note text
We can define a basic note text as a “string” (of characters).
The note text needs to be in double quotes, so VBA knows it’s plain text. We used an equals “=” to store the note text value in the variable.
This is not strictly necessary, but it helps make our macro easier to read.
Set the current paragraph Range
Given the intended note placement, it's convenient to define a working Range corresponding to the whole original paragraph.
We must “Set” the Range since it contains other information than just a value.
This works even if the starting selection doesn’t include the whole paragraph.
This is an example of using Ranges to make writing your macros easier. It is independent of the initial selection, if any, in the sense that we can manipulate it without directly changing the selection (unless we use it to delete or modify text within the original selection).
Inserting the note text
Now insert the new novel note paragraph.
Finally insert the actual note text.
We have to give the InsertBefore command the text to insert into the document.
Both of these commands extend MyParagraphRange to include the newly added characters.
Setting a note paragraph style
A different style will set your note apart from the novel text better.
Collapsing the paragraph Range
Since MyRange now spans both paragraphs, we first collapse the paragraph Range, so the style only applies to the note paragraph.
Setting the style
We set the paragraph style using the Style property of the Range.
Notice we just used a literal style name as text and let VBA do all the work under the hood to make it happen.
Of course, the Scene Note style must exist. Unfortunately, it will actually cause an error if not, so just be sure your note style is included in your work in progress.
Does the style exist error?
Ideally we would check whether the style exists first before trying to apply it to a paragraph, but detecting whether a given style is valid is more complicated than it should be, so that is a lesson for another day.
Finish the macro
Now put the commands together.
This one definitely helps me include reminders to myself during editing while still allowing me to move on with my writing at the moment.
I have several variants of this macro assigned to different keyboard shortcuts.
The extended version below incorporates possible selections into the note. If you're interested in other variants, let me know.
Ignoring the paragraph Range at the end
We’re not doing anything with the MyParagraphRange at the end since we don’t need it anymore.
Improvements
Selection variation
When I write in a historical genre, I sometimes know a period-specific word exists for something or they did things a certain way during the time period, but while writing, I often just can't think of it at the moment, but I don’t want to break my momentum by stopping to look it up right then.
Granted we don't want to leave "everything" for the editing phase, but my priority in the first draft is to get the story on the page. Some details just have to wait.
What does this have to do with macros?
We can make a more targeted note for ourselves by selecting the text and let the macro include it in the note. Then just keep writing.
Getting the selection text
The selected text is accessed using the obvious Selection's Text property.
This stores the plain text of the selection (no formatting). If there is no selected text, the Text property will contain no characters.
Now we can create our note using any selected text.
Using plus “+” with strings adds or “concatenates” them together into one string. The result is then stored in the note variable using the equals “=” sign.
The extra space in the double quotes irritates me if there is no selection, but you won’t see it in the document unless you have hidden characters visible.
Automatically select the previous word
If you don’t want to even bother with selecting the last word for your note, you can have the macro to automatically select it.
This part is extra optional, of course, but it pairs nicely with using the selected text.
It will expand to the left if there is no word immediately to at the insertion point which works well for our use case.
We've used the Expand command before with the Selection, so we'll go quick here. Other possible Units include sentences, paragraphs, etc. but not every unit type in the regular Units list. Unlike the F8 key expand shortcut, the VBA Expand command will not expand past the given unit size, if specified.
Personally, I would trigger this expanded selection option only if there wasn’t already an initial selection.
The Selection Type is taken from this list.
This does muck around with the initial position in the document which is against one of my goals when writing utility macros for writers, but I allow it here since I don't want to further complicate the macro.
Selection Type details
If you're wondering, we use this particular Selection Type, wdSelectionIP (standing for Word selection insertion point; see this article for more explanation) since the more obvious choice, wdNoSelection, does not seem to refer to “no selection” in the intuitive sense a regular Word user might expect in practice ... just an insertion point with no text selected.
In fact, it's a little difficult to ascertain exactly what it does refer to, in general, and the documentation is terse about it just saying “No Selection.” Chalk it up to one of the unsolved mysteries of the universe.
Revised previous paragraph note example
The variation including selected text might look like:
I would probably have it as a separate note macro in addition to basic notes.
My personal variations are different. For example, we could trim extra spaces from any selected text, but this gets the idea across.