• Path not always correct (WinXP / Word2003 NL)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Path not always correct (WinXP / Word2003 NL)

    Author
    Topic
    #408471

    I’ve written a little routine to load a template in Word for editing and attached it to a commandbar button. It worked fine in Win98 / Word97:

    Sub LoadDot()
    Dim strPath As String
    strPath = Options.DefaultFilePath(wdCurrentFolderPath)
    ChangeFileOpenDirectory Options.DefaultFilePath(wdUserTemplatesPath)
    With Dialogs(wdDialogFileOpen)
    .Name = “*.dot”
    .Show
    End With
    ChangeFileOpenDirectory strPath
    End Sub

    In WinXP / Word2003 however, in about 25% of all cases the dialog opens in the default documents path instead. When I close the dialog with Cancel and click on the button again, the dialog is showing the desired path. Any idea’s why and how to work around this?

    Viewing 1 reply thread
    Author
    Replies
    • #862746

      I fear that Klaus Linke’s comment in post 384611 applies here.

      • #862752

        bummer
        Thanks Hans.

        • #933717

          Hi Jan, did you ever find a way around this one? We are experiencing it more and more too.

          • #933763

            Hi Karen,

            Unfortunayely. no. I also tried to comment out the path changing lines and change the .Name line in
            .Name = Options.DefaultFilePath(wdUserTemplatesPath) & “*.dot”
            but that didn’t help either. This always opens the My Documents folder.
            So I had to stick with the code in this thread and get used to the Cancel & Try again method. sad

      • #862753

        bummer
        Thanks Hans.

    • #862747

      I fear that Klaus Linke’s comment in post 384611 applies here.

    Viewing 1 reply thread
    Reply To: Path not always correct (WinXP / Word2003 NL)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: