Fab117
06-08-2007, 12:00 AM
Hi,
When I write a word document, I have to put it in a common share
For security I would like to always do a copy of it in my folder.
I did it without trouble for my Excel workooks with : ThisWorkbook.SaveCopyAs Filename:=...
I tried to do the same for the word documents, but SaveCopyAs as not the same meaning for word than for Excel :
This code doesn't work (error message on SaveCopyAs) :
Private Sub Document_Close()
Dossier = "H:\DATA\GF\Tmp\Dev macro enregistrement copie\2\"
Count = Len(ActiveDocument.Name)
Nom = Left(ActiveDocument.Name, Count - 4)
strDate = Format(Date, "dd-mm-yy") & " - " & Format(Time, "h-mm-ss")
ThisDocument.SaveCopyAs FileName:=Dossier & Nom & " - " & strDate & ".doc"
End Sub
Could someone help me to solve this problem ?
To resume, I want that each time thet I close my document, word save a Copy of it in the folder "H:\DATA\GF\Tmp\Dev macro enregistrement copie\2\"
Thanks.
Fab
When I write a word document, I have to put it in a common share
For security I would like to always do a copy of it in my folder.
I did it without trouble for my Excel workooks with : ThisWorkbook.SaveCopyAs Filename:=...
I tried to do the same for the word documents, but SaveCopyAs as not the same meaning for word than for Excel :
This code doesn't work (error message on SaveCopyAs) :
Private Sub Document_Close()
Dossier = "H:\DATA\GF\Tmp\Dev macro enregistrement copie\2\"
Count = Len(ActiveDocument.Name)
Nom = Left(ActiveDocument.Name, Count - 4)
strDate = Format(Date, "dd-mm-yy") & " - " & Format(Time, "h-mm-ss")
ThisDocument.SaveCopyAs FileName:=Dossier & Nom & " - " & strDate & ".doc"
End Sub
Could someone help me to solve this problem ?
To resume, I want that each time thet I close my document, word save a Copy of it in the folder "H:\DATA\GF\Tmp\Dev macro enregistrement copie\2\"
Thanks.
Fab