R
Roger Marrs
The following code was developed for use with Word 2003 and it works fine.
However, I've run into a situation where the code seems like it fails to
execute on a Word 2000 machine. Here's the code:
Dim FSO As FileSystemObject
Dim NewDir As String
Set FSO = CreateObject("Scripting.FileSystemObject")
NewDir = "\\Server\FullCase\CaseDocs\" & CaseNumber
If Not FSO.FolderExists(NewDir) Then
FSO.CreateFolder NewDir
End If
With Dialogs(wdDialogFileSaveAs)
.Name = "\\Server\FullCase\CaseDocs\" & CaseNumber & "\" & DocFileName
.Show
End With
What's supposed to happen: Step 1 - The code is supposed to check for the
existence of a specific file folder and to create the folder if it doesn't
exist. Step 2 - Then the Word SaveAs dialog box is supposed to be presented
to the user, with the file path defaulted to the folder that either already
existed or was just created by Step 1.
What actually happens in Word 2000: The Word SaveAs dialog opens with the
file path apparently set to the last place used by Word to save a document.
So my questions are: 1) Is the use of Word 2000 the reason this code isn't
working? 2) If so, can the same task be accomplished in Word 2000? 3) If
so, can someone help me modify the code so it works correctly in Word 2000?
4) And finally, if the version of Word in use is not the culprit here, what
else could be causing the problem?
However, I've run into a situation where the code seems like it fails to
execute on a Word 2000 machine. Here's the code:
Dim FSO As FileSystemObject
Dim NewDir As String
Set FSO = CreateObject("Scripting.FileSystemObject")
NewDir = "\\Server\FullCase\CaseDocs\" & CaseNumber
If Not FSO.FolderExists(NewDir) Then
FSO.CreateFolder NewDir
End If
With Dialogs(wdDialogFileSaveAs)
.Name = "\\Server\FullCase\CaseDocs\" & CaseNumber & "\" & DocFileName
.Show
End With
What's supposed to happen: Step 1 - The code is supposed to check for the
existence of a specific file folder and to create the folder if it doesn't
exist. Step 2 - Then the Word SaveAs dialog box is supposed to be presented
to the user, with the file path defaulted to the folder that either already
existed or was just created by Step 1.
What actually happens in Word 2000: The Word SaveAs dialog opens with the
file path apparently set to the last place used by Word to save a document.
So my questions are: 1) Is the use of Word 2000 the reason this code isn't
working? 2) If so, can the same task be accomplished in Word 2000? 3) If
so, can someone help me modify the code so it works correctly in Word 2000?
4) And finally, if the version of Word in use is not the culprit here, what
else could be causing the problem?