wdDialogFileSaveAs won't accept filename variable

R

Roger Marrs

I've been able to narrow down the problem I was seeking help on in an
earlier thread. For some reason when using Word2000 the code I'm using to
insert a file name into the SaveAs dialog box causes problems. I apologize
for not narrowing the problem down before starting the other thread.

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 results in
that problem:
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
 
S

Sriraman CS

use like this:

ChangeFileOpenDirectory "C:\"

which will change the file open path.

Regards,

CS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top