/AutoStyleSeparator

VBA Macro that automatically inserts run-in style separators.

Primary LanguageVisual Basic

AutoStyleSeparator

In the legal industry, it is common practice to have to use "style separators" to create a working table of contents in most legal agreements. For example:

Legal Agreement Text:

Section 1.01 Defined Terms(style separator). Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nibh felis, ornare sit amet gravida vitae, suscipit sed lectus. Etiam imperdiet turpis id dolor auctor pulvinar. Donec accumsan ligula in odio luctus tincidunt. Pellentesque non porta erat, quis lacinia dolor. Sed ut ligula at dolor ultricies imperdiet. Sed semper convallis nulla. Etiam fringilla odio venenatis nunc ornare, ut congue ligula rhoncus. Phasellus nunc tellus, fringilla in aliquet ut, tincidunt eu lacus. Praesent varius tristique ex cursus eleifend.

...and so on

Typically these have to be manually inserted by a word processor, which can easily take hours in agreements exceeding 100 pages. This macro will automatically insert MS Word's default style separator before the first period of a specified paragraph style. This allows MS Word to differentiate the first sentence of the paragraph as the title, allowing one to use MS Word's Table of Contents feature. This is done through a custom form, which displays all active styles used in the document, that pops up when the macro is called.

I hope to upload a video demonstration of this soon as this might be unclear to those not familiar with the practice of using style separators.