I’ve been trying to solve a personal problem for a long time.
No, this blog hasn’t suddenly turned “confessional”. No TMI here.
The problem I’m referring to is this:
See that “3” that’s boxed in red above? That’s my problem. I wouldn’t say it’s the bane of my existence, but it still bugs me.
You see, I do a lot of Answers to Complaints in my day job. And I don’t know how you do it where you practice, but in our area, there are always sort of “catch all” paragraphs in the Complaint that we just answer with a standard “yeah, we’re just going to repeat our answer to all the above paragraphs without actually repeating it” statement.
That paragraph in the answer always starts with a reference to Paragraph 1 and ends with a reference to the immediately preceding paragraph. And if I’m using automatic paragraph numbering, that ought to be a breeze, right? If those paragraph numbers are driven by fields (which is all automatic paragraph numbering is), then I should be able to calculate “current paragraph number minus 1”. I’ve learned how to insert the current paragraph number into a paragraph. Why not the previous one?
Except … no. At least not according to the Microsoft MVPs I spoke to:
Well … darn. I was really hoping one of those guys could come up with something. (Yes, I could just type the stupid number—I do that now—but this still eats at me.)
But check out that mention of SEQ fields. I’ve used SEQ fields before. And if I combine them with some sort of Building Block, like Quick Parts or AutoText, I could actually make this work.
In fact, one of them suggested that very thing, and another gave me the actual formula:
Oh, snap! That actually works! Here’s what the underlying code looks like:
Yeah. Gnarly-looking, right? Here’s what I did:
- To create the initial paragraph numbers, I went to the Insert tab, clicked on the Quick Parts and clicked on Field.
- I used an SEQ field, named it “ansnum”, clicked Options in the Field dialog box to add switches, chose Arabic numerals from the General Switches dialog, chose “\n” from the Field Specific Switches dialog to increment the number, then pressed OK. These two steps created the numbering sequence for the 1, 2, 3 paragraph numbers show at the beginning of each paragraph.
- To get the current paragraph number to display, I did the same steps above but substituted “\c” for the last switch to pull the current paragraph number.
- To get the prior paragraph number (“… through 2“), I did it keyboard-style: I pressed CTRL-F9 twice to create two sets of curly braces to create a calculated field, typed an equal sign (=) directly after the first curly brace, typed “SEQ ansnum \c” inside the interior set of curly braces to pull the current paragraph number (3), then typed “-1” just before the end curly brace to calculate “current paragraph number minus one”. To get the field to calculate, I pressed F9 (Update Fields) to complete it.
Now, I know what you’re thinking: “That’s an awful lot of trouble to go to just to get out of typing a 2.” Yes, you’re right, it wouldn’t make sense to go through all this trouble just to type paragraph numbers and references to current and last paragraph numbers. Which is why I’m turning these into AutoTexts!
You see that way, I can type “ansnum” to insert an incrementing number, “ansnumcurr” to insert the current paragraph number, and “ansnumlast” to insert the previous paragraph number.
(Tip: To play this full-screen, click the arrows in the lower right-hand corner of the video. They become visible when you hover your mouse over the player or, if you’re on a mobile device, when you “click” inside the video using your finger or stylus.)
So, what do you think? Useful? Not? Let me know in the comments!