At ASI, we’re working on book skeletons while we do task analysis for new documentation or feature updates that may change the way users do their work with iMIS. So, to get early feedback, we wanted a way to publish an outline of that skeleton book with no page numbers, but headings and subheading levels indicated clearly.
My first attempt at a macro called within the AfterPublish macro gave me the inverse of what I wanted (content but no outline), but my coworker Mary Connor, being the VBA expert that she is, came up with a working macro. It basically says, if you’re a section break after the 2nd section break, throw that content away but keep the table of contents content.
Here is an overview of the steps to get an outline out of a book made in Author-it.
These are pre-requisites to the publishing step:
In Author-it, create a six-level TOC object that doesn’t contain page numbers. Six was the number of levels we thought was an extreme case, and you can’t go higher than six levels of heading in HTML anyway, so six seems like a good number for us. Your situation may vary.
In the .dot file that contains your AfterPublish macros, create a TrimToOutline macro that contains this code:
Sub TrimToOutline() ' ' Freezes table of contents field, then strips off everything after the contents: ' Macro recorded 6/26/2008 by Mary Connor Dim dSection As Section Selection.WholeStory Selection.Fields.Unlink For Each dSection In ActiveDocument.Sections If dSection.Index > 2 Then dSection.Range.Delete End If Next End Sub
In the Sub AfterPublish() area of your Word template file, put a call to TrimToOutline.
In Author-it, create a new book template for outlines, and point it to the .dot file that contains that macro code above.
Next are the steps for publishing your sub-book content to a Word outline-only document. It’s not actually in the Word outline view, but rather, a table of contents without page numbers, but based on the skeleton sub-books placed within the book you’ll create below.
- In Author-it, create a book using the outline book template that you created previously.
- Drag any sub-books into this new book and save the new book.
- Publish to Word.
The resulting Word document should contain only a title page and a table of contents.
I’d love to hear feedback or ideas for improving this specialized output for Author-it, so please feel free to comment.