Hi!
I would like to use a vba routine of my Excel where I can open a certain
directory ("G:\DATES\") to select a file but this doesn?t work in Word:
ChDrive "G:\"
ChDir "G:\DATES\"
o_dir = Application.GetOpenFilename("Winword.exe (*.*), *.*")
Workbooks.Open FileName:=o_dir
Thanks
Bernd
Rick Gutzmer - 09 Feb 2005 16:41 GMT
Change this line:
Workbooks.Open FileName:=o_dir
to this:
Documents.Open FileName:=o_dir
> Hi!
>
[quoted text clipped - 8 lines]
> Thanks
> Bernd
Rick Gutzmer - 09 Feb 2005 17:48 GMT
sorry - jumped the gun. Try this:
Dim o_dir As String
o_dir = Options.DefaultFilePath(Path:=wdDocumentsPath)
Options.DefaultFilePath(Path:=wdDocumentsPath) = "D:\syxta\templates"
With Application.Dialogs(wdDialogFileOpen)
.Name = "*.doc; *.rtf"
.Show
End With
Options.DefaultFilePath(Path:=wdDocumentsPath) = o_dir
Templates("normal.dot").Saved = True 'so you don't get prompted to save
the normal template on exit
> Hi!
>
[quoted text clipped - 8 lines]
> Thanks
> Bernd