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?