The trick that we used on the previous page opens the door to lots of useful applications. For example, if you use Word mainly to write letters and only occasionally for something else, you could write an AutoExec program to ask whether to load a default "personal letter" or the generic Word environment.
~~~~~~~~~~~~~~~~~~~~~~~~~
Public Sub AutoExec()
Dim MsgBoxResult
Dim SaveFileName
MsgBoxResult = _
MsgBox( _
"Click Yes to load the default letter" _
& vbCrLf & _
"Click No to load default Word.", _
vbYesNo, "Document Environment")
If MsgBoxResult = vbYes Then
Documents.Open _
("C:\DefaultLetter.doc")
SaveFileName = _
InputBox( _
"Enter a name for the letter", _
"Letter Name ?")
If SaveFileName <> "" _
Then _
ActiveDocument.SaveAs (SaveFileName)
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~

