Automating Drop Caps in Microsoft Word (and Other Fun Scripts)

Have you ever gone through, chapter by chapter, and painstakingly added drop caps to your novel? Well, that ends today. I’m originally a software engineer by trade, turned dark fantasy writer, so here’s a little script I made to create all the drop caps for you. This is especially handy if you are using a tool like Scrivener which exports to word, where you then have to do a bunch of post processing. Plus I’ll share some other scripts I made that are super handy.

My drop cap script finds all the “Heading 1” styled paragraphs (chapter titles), then finds the first full justified paragraph and ensures it has a drop cap (if it already has one, it moves on to the next chapter).

For my script to work, ensure you style your Scrivener chapter title output to use “Heading 1” for the chapter names. If you don’t use Scrivener, ensure you are setting all your chapter title text styled as “Heading 1”.

It might sound scary running scripts, but I promise it’s super easy. To run them, you must enable the developer tab on the ribbon. The Developer tab isn’t displayed by default.

On the File tab, go to Options Customize Ribbon. Then, under Customize the Ribbon and under Main Tabs, select the Developer check box. Save and close the options.

Now you’re all set to run scripts. Go to the new Developer tab on the ribbon, then select Visual Basic. A new window appears. Click Insert -> Modules, then paste in all the code from here:

https://gist.github.com/jjxtra/5065efe8a0c0def823512afab77fd2e3

Once you do that, back in Word on the Developer tab, click macros, then double click the script to run. Some might take a few seconds or up to a minute, so be patient.

The scripts I use everytime are RemoveFirstBlankLineEachPage (fixes Scrivener adding a blank line at the start of each chapter), ChangeFootnoteNumbersTo10Point (thanks Scrivener for outputting such ginormous footnote numbers), AdjustImagesWithPaddingAndWrapping (my novels have lots of pictures and this makes square images alternate left and right while making other images appear in front of text, all while ensuring padding), and lastly ApplyDropCapToChapters. If you aren’t using Scrivener, you only care about the ApplyDropCapToChapters function.

I use these scripts to format Bane War books when I export from Scrivener to Microsoft Word. By the way, you should always choose RTF format for the output, load that in Word, then export to a docx, without compatibility mode.

Hope this saves you a bunch of time. It sure has for me. I can export from Scrivener for a 210k word novel, run these scripts, due a quick formatting pass and be done in less than fifteen minutes.

Software engineer and author

Leave a Reply

Your email address will not be published. Required fields are marked *

*