Saturday, December 22, 2007

Save your outline unchanged in Word Outline View

A pet peeve of mine is that Microsoft Word doesn't save which levels are visible and which are hidden in Outline View. I finally put my preferred workaround into some simple macros and so thought I'd share it.

This is little shy on technical details, but I'll try to answer any questions left in the comments!

The main trick is that you leave Fast Save on (Tools > Options > Save) while you work on the document, but turn it off just before you save. So the first macro turns Fast Save off, saves and then closes the document ("CloseOffFastSave"). The second macro turns Fast Save on just before you open a document.

I put the close macro in the file menu, as well as have it in it's own toolbar button. Leave the existing "Close" there (without the shortcut key) as a convenience for closing documents you don't want to save. Let the Macro save your document! Make sure the last save is done by the Macro.

Here's Microsoft's explanation for how to set up these macros, and here are the macros you'll need:

Sub AutoExec()
'
' AutoExec Macro
' Turns Fast Save On
' Allows saving view of Outline levels later
'
With Options
.AllowFastSave = True
End With
Application.DefaultSaveFormat = "MSWord6RTFExp"
End Sub
------------------------------------------
Sub CloseOffFastSave()
'
' Saves view of expanded/unexpanded levels
' in Outline View, so everything isn't automatically expanded
' when you next open the document--and then closes document
'
With Options
.AllowFastSave = False
End With
Application.DefaultSaveFormat = "MSWord6RTFExp"
ActiveDocument.Save
ActiveDocument.Close
End Sub
------------------------------------------
Sub AutoOpen()
'
' AutoExec Macro
' Turns Fast Save On
' Allows saving view of Outline levels later
'
With Options
.AllowFastSave = True
End With
Application.DefaultSaveFormat = "MSWord6RTFExp"
End Sub

Remember, let the Macro save your document! Make sure the last save is done by the Macro.

1 comment:

  1. Do you know how to achieve the same result in Word 2007?

    ReplyDelete