tags:

views:

156

answers:

1

Hi, Our client enironment recently migrated from word 2000 to 2003, we use the below code in one of the templates to show the word's default insert file dialog box. Word is integrated with another third party application Hummingbird docspen.

With Dialogs(wdDialogInsertFile) .Name = "q:*.*"

   .Show

End With In old environment it opens up the default insertfile dialog box pointing to my documents folder, where as in word 2003, it opens up the Docsopen insertfile dialog box.

I have compared the settings of word 2000 and 2003 it seems to be same.

Any suggestions on this please.

A: 

Sorry I can't reproduce this on Word 2003 / Win XP . Copy/Pasted your code and got the "Insert File" dialog box. Only thing not working is to point to your directory q:

For this you have to set Options.DefaultFilePath(wdDocumentsPath) first, like in

Private Sub CommandButton1_Click()

' save current doc path and set to insert path
MyPath = Options.DefaultFilePath(wdDocumentsPath)
Options.DefaultFilePath(wdDocumentsPath) = "C:\"

' display insert file dialog
With Dialogs(wdDialogInsertFile)  ' this works in debug mode as well as on clicking Command Button from Doc
    .Name = "*.txt"
    .Show
End With

' restore original doc path
Options.DefaultFilePath(wdDocumentsPath) = MyPath

End Sub

Good luck MikeD

MikeD