R
Roger Marrs
I also posted this question on the vba.beginners list, but thought maybe
this list might be more appropriate.
For some reason when using Word2000 the code I'm using to
insert a file name into the SaveAs dialog box causes problems.
The following code works to open the SaveAs dialog box ready to save a
document in a specific folder:
With Dialogs(wdDialogFileSaveAs)
.Name = "\\Server\FullCase\CaseDocs\" & CaseNumber & "\"
.Show
End With
Using that code the correct folder is opened and the only thing the user
needs to do is enter a filename for the document.
What I really want to happen is for the macro to pre-fill the filename
section of the SaveAs dialog box. In Word2003 I'm able to make this happen
using the following code. However, in Word2000 the dialog box opens to the
last folder used by Word to save a document, rather than using the folder
path designated by the macro. Here's the code I'm using that works in
Word2003 but not Word 2000:
With Dialogs(wdDialogFileSaveAs)
.Name = "\\Server\FullCase\CaseDocs\" & CaseNumber & "\" & DocFileName
.Show
End With
As you can see, the only difference between the two versions of code is the
addition of the variable "& DocFileName." The variable is handled earlier
in the macro code with a Dim as String statement and the variable
DocFileName obtains it's value from a bookmark in the ActiveDocument.
Does anyone know why adding the variable & DocFileName screws up this
otherwise handy bit of code in Word2000, but not Word2003?
Roger
this list might be more appropriate.
For some reason when using Word2000 the code I'm using to
insert a file name into the SaveAs dialog box causes problems.
The following code works to open the SaveAs dialog box ready to save a
document in a specific folder:
With Dialogs(wdDialogFileSaveAs)
.Name = "\\Server\FullCase\CaseDocs\" & CaseNumber & "\"
.Show
End With
Using that code the correct folder is opened and the only thing the user
needs to do is enter a filename for the document.
What I really want to happen is for the macro to pre-fill the filename
section of the SaveAs dialog box. In Word2003 I'm able to make this happen
using the following code. However, in Word2000 the dialog box opens to the
last folder used by Word to save a document, rather than using the folder
path designated by the macro. Here's the code I'm using that works in
Word2003 but not Word 2000:
With Dialogs(wdDialogFileSaveAs)
.Name = "\\Server\FullCase\CaseDocs\" & CaseNumber & "\" & DocFileName
.Show
End With
As you can see, the only difference between the two versions of code is the
addition of the variable "& DocFileName." The variable is handled earlier
in the macro code with a Dim as String statement and the variable
DocFileName obtains it's value from a bookmark in the ActiveDocument.
Does anyone know why adding the variable & DocFileName screws up this
otherwise handy bit of code in Word2000, but not Word2003?
Roger