I have captured the fileSave as Menu so I can run a naming macro. The problem I have is that If I have two Documents Open and I save, The First File is saved with the new file name. for instance if I have Doc1 and doc2 and do a save as on doc2 with the name set as doc3. Doc1 is saved under the newFile name. Here is my code
Dim menuname, varFileName, docType As String
Dim fd As FileDialog
Dim frmDiag As Dialog
Dim propDiag As Dialog
Dim docFirst As Document
Set docFirst = Documents.Item(1)
If docType <> "" Then
NameDoc (docType)
End If
menuname = CommandBars(1).Name
CommandBars("file"
.Controls("Properties"
.Execute
menuname = CommandBars(1).Name
'Overrides the File Save As and displays the FileDialog Form
If strLeafCode = "" Then
strLeafCode = "Letter"
End If
NameDoc (strLeafCode)
Set fd = Application.FileDialog(msoFileDialogSaveAs)
fd.InitialFileName = strNewFileName
fd.Show
fd.Execute
End Sub
Any Ideas?
Dim menuname, varFileName, docType As String
Dim fd As FileDialog
Dim frmDiag As Dialog
Dim propDiag As Dialog
Dim docFirst As Document
Set docFirst = Documents.Item(1)
If docType <> "" Then
NameDoc (docType)
End If
menuname = CommandBars(1).Name
CommandBars("file"
menuname = CommandBars(1).Name
'Overrides the File Save As and displays the FileDialog Form
If strLeafCode = "" Then
strLeafCode = "Letter"
End If
NameDoc (strLeafCode)
Set fd = Application.FileDialog(msoFileDialogSaveAs)
fd.InitialFileName = strNewFileName
fd.Show
fd.Execute
End Sub
Any Ideas?