hi, i have this simple code that saves to a normal document from a template.
Sub AutoClose()
Dim Savepath As String
Dim DocumentName As String
Dim box As String
Savepath = "G:\Administrativos\Credenciais de Deslocação\Dr. Carlos
Pinto\Credenciais Guardadas\"
box = InputBox("Qual o nome que deseja guardar", "Guardar")
DocumentName = box + Format(Now, "YYYY-MM-DD")
ActiveDocument.SaveAs FileName:=Savepath + DocumentName
End Sub
When i click on the close button it saves correctly and save it in normal
document, know, my question is when i open the normal document and close it
it appears again th InpuBox and saves again.
In the template, how can i do in VBA when save eliminate the code VBA of the
normal document.
Thanks
Tony Jollans - 11 Nov 2005 13:20 GMT
The AutoClose runs (from the template) every time you Close the document.
If you want to keep the same template attached to the document, perhaps the
easiest way is to check if the document has a path ..
Sub AutoClose()
Dim Savepath As String
Dim DocumentName As String
Dim box As String
If Activedocument.path <> "" then Exit sub
Savepath = "etc. etc.:
--
Enjoy,
Tony
> hi, i have this simple code that saves to a normal document from a template.
>
[quoted text clipped - 19 lines]
> normal document.
> Thanks
Bruno Coelho - 11 Nov 2005 14:56 GMT
Hi,
It works well
Thanks a lot Tony
> The AutoClose runs (from the template) every time you Close the document.
>
[quoted text clipped - 41 lines]
> > normal document.
> > Thanks