R
Roger
I would like to add a feature to the following code. I'd like to be able to
have the macro check for the existence of the File Folder, and if the folder
does not exist, to create the folder, and then save the file to that newly
created folder. I have looked in the VBA editor help files and the Word MVP
site for some guidance in how to accomplish this, but haven't found anything
that really helps. Here is the code that I want to add on to:
With ActiveDocument
Dim CaseNumber As String
Dim DocFileName As String
CaseNumber = ActiveDocument.Bookmarks("SaveFileNumber").Range.Text
DocFileName = ActiveDocument.Bookmarks("DocFileName").Range.Text
With Dialogs(wdDialogFileSaveAs)
.Name = "\\lvco-dc\prosecutor\CaseDocs\" & CaseNumber & "\" &
DocFileName
.Show
End With
End With
The name of the file folder that I want to search for is represented by the
variable called CaseNumber. Currently, if the folder for the CaseNumber
variable doesn't exist, then the SaveAs dialog box opens up at the CaseDocs
folder. Instead of having that happen, I would like to create a new folder
in CaseDocs with that new folder's name being supplied by the CaseNumber
variable.
Any assistance would be greatly appreciated.
Roger
have the macro check for the existence of the File Folder, and if the folder
does not exist, to create the folder, and then save the file to that newly
created folder. I have looked in the VBA editor help files and the Word MVP
site for some guidance in how to accomplish this, but haven't found anything
that really helps. Here is the code that I want to add on to:
With ActiveDocument
Dim CaseNumber As String
Dim DocFileName As String
CaseNumber = ActiveDocument.Bookmarks("SaveFileNumber").Range.Text
DocFileName = ActiveDocument.Bookmarks("DocFileName").Range.Text
With Dialogs(wdDialogFileSaveAs)
.Name = "\\lvco-dc\prosecutor\CaseDocs\" & CaseNumber & "\" &
DocFileName
.Show
End With
End With
The name of the file folder that I want to search for is represented by the
variable called CaseNumber. Currently, if the folder for the CaseNumber
variable doesn't exist, then the SaveAs dialog box opens up at the CaseDocs
folder. Instead of having that happen, I would like to create a new folder
in CaseDocs with that new folder's name being supplied by the CaseNumber
variable.
Any assistance would be greatly appreciated.
Roger