R
Roger Shuttleworth
Hello
Warning: VBA beginner here...
I have a template called request.dot that contains the
following macros:
Public Sub SaveDoc()
Dim strDate As String
Dim dlgMySave As Dialog
strDate = Format(Date, "yyyy-mm-dd")
Set dlgMySave = Dialogs(wdDialogFileSaveAs)
dlgMySave.Name = strDate & " - " & txtDept.Value
dlgMySave.Show
End Sub
Sub FileSave()
'Saves the active document or template
SaveDoc
End Sub
The idea is the the FileSave command is intercepted to
open the Save As dialog, then insert a filename that
consists of the date followed by the value of the txtDept
control.
When I create a doc from the template, and click Save, the
SaveAs dialog doesn't pick up the value of txtDept from
the derived doc; instead it picks it up from the template,
where the value is "". How can I force it to use the value
in the new document instead?
Thanks for your help.
Roger Shuttleworth
Warning: VBA beginner here...
I have a template called request.dot that contains the
following macros:
Public Sub SaveDoc()
Dim strDate As String
Dim dlgMySave As Dialog
strDate = Format(Date, "yyyy-mm-dd")
Set dlgMySave = Dialogs(wdDialogFileSaveAs)
dlgMySave.Name = strDate & " - " & txtDept.Value
dlgMySave.Show
End Sub
Sub FileSave()
'Saves the active document or template
SaveDoc
End Sub
The idea is the the FileSave command is intercepted to
open the Save As dialog, then insert a filename that
consists of the date followed by the value of the txtDept
control.
When I create a doc from the template, and click Save, the
SaveAs dialog doesn't pick up the value of txtDept from
the derived doc; instead it picks it up from the template,
where the value is "". How can I force it to use the value
in the new document instead?
Thanks for your help.
Roger Shuttleworth