2007: Make Auto-format options document-specific

D

devistated

On any given day, I have to deal with documents that require completely
different auto-format setttings. For example, using normal modern documents,
the default auto-format settings are fine (change quotes to smart quotes,
change double dash to long hyphen, etc.) But I am also processing documents
from the 1940's that need to stay as closely as possible to the formatting of
the orignal documents (thus no smart quotes, no changing of double dashes to
long dashes, etc.).

I am constantly screwing up documents because I forgot to change the
auto-format settings and started working with one type of document while
another type of document's auto-format settings were still in effect.

Is there any way to save the auto-format settings with the document and then
have the autoi-formatting options automatically set to the correct settings
when I open that document again later?

This is a MAJOR hassle.
 
G

Greg Maxey

Not fully testted, but you might use a AutoOpen and AutoClose macro stored
in Normal.dotm. Something like this:

Sub AutoOpen()
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
With Options
On Error Resume Next
MsgBox oDoc.Variables("AFRQ").Value
.AutoFormatReplaceQuotes = oDoc.Variables("AFRQ").Value
.AutoFormatReplacePlainTextEmphasis = oDoc.Variables("AFRPTE").Value
End With
End Sub

Sub AutoClose()
MsgBox "Test"
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
With Options
oDoc.Variables("AFRQ").Value = .AutoFormatReplaceQuotes
oDoc.Variables("AFRPTE").Value = .AutoFormatReplacePlainTextEmphasis
End With
End Sub

You would have to write the additional code for all the options you want
covered. This way when a document is saved, the AutoFormat settings used in
the document is saved as variable values. When the document is opened again
those variable values set the the AutoFormat options.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top