File, Open dialog box revert to *.doc

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 16277
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

File, Open dialog box revert to *.doc

Post by ChrisGreaves »

I'm not sure how to make my Word 2003 File, Open dialog box revert to *.doc after I have used it to open a template and would appreciate guidance.
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
If it isn't one thing it's another, and very often both. E.F.Benson

User avatar
Don Wells
5StarLounger
Posts: 689
Joined: 27 Jan 2010, 16:45
Location: Ottawa, Ontario, Canada

Re: File, Open dialog box revert to *.doc

Post by Don Wells »

Hi Chris
    Consider revising the final lines in your code to the following. Sorry, but there's some screen flicker associated with it that I am unable to overcome.

Code: Select all

        With Dialogs(wdDialogFileOpen)
            .Name = "*.doc; *.doc*" ' revert to Word documents
            .Show (1) ' Show for approx 1 ms
        End With
    End Sub
H.T.H.
Regards
Don

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 16277
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: File, Open dialog box revert to *.doc

Post by ChrisGreaves »

Don Wells wrote:    Consider revising the final lines in your code to the following.
Hi Don.
However do you you come up with this stuff?
I not only considered it, I implemented it and have been running with it for a day.
Your code works great as far as I can tell.

Part of the "as far as I can tell" problem is that once the annoyance goes away, I tend not to notice that it's gone - a bit like a sore knee that stops being sore. I don't realize it until someone asks me "How's the knee?".
If it isn't one thing it's another, and very often both. E.F.Benson

User avatar
Leif
Administrator
Posts: 7296
Joined: 15 Jan 2010, 22:52
Location: Middle of England

Re: File, Open dialog box revert to *.doc

Post by Leif »

How's the knee?
Leif

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 16277
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: File, Open dialog box revert to *.doc

Post by ChrisGreaves »

Leif wrote:How's the knee?
Coming up! :bif:
If it isn't one thing it's another, and very often both. E.F.Benson