The macro below is one of a pair (its cousin opens a template and adds one to the filename, hence "VBEOpenUp").
It presents me with a FileOpen dialogue geared to *.dot, which I want, but the next time I use Word's File Open command, i am still looking at *.dot, whereasIi wish it would revert to *.doc.
I have played a little bit with the .Update method to no avail, so it is commented out right now.
Code: Select all
Public Function VBEOpen()
' Procedure : cmd_VBE
' Description: Open/Maximize the VBE; open a document/template.
' By: Chris Greaves With GREAT help from Kevin Paddock .
' Side Effects: Appears to bypass the macro-security check.
Dim strName As String ' Retain filename/extent from dialogue box.
With Dialogs(wdDialogFileOpen)
.Name = "*.dot" ' Specifically interested in templates, since we're opening VBE
If .Show = -1 Then
strName = .Name ' Grab the Name; user will have navigated to DefaultFilePath.
Documents.Open Filename:=Options.DefaultFilePath(wdDocumentsPath) _
& Application.PathSeparator & strName
Else
End If
End With
' 6495: Code in "VBEOpen" and "VBEOpenUp" should revert the dialog box to *.doc.
With Dialogs(wdDialogFileOpen)
.Name = "*.doc" ' revert to Word documents
' .Update ' ??
End With
End Function