Anthony47 ha scritto:Eh gia', l'avevo fatta troppo semplice...
Modifica la macro in
- Codice: Seleziona tutto
Sub reren2()
Dim myOld As String, myName As String, myNName
'
myOld = ActiveDocument.FullName
myName = ActiveDocument.Name
mysplit = Split(myName, ".doc", , vbTextCompare)
myext = ".doc" & mysplit(UBound(mysplit, 1))
'myNName = Split(myName, ".doc", , vbTextCompare)(0)
myNName = Split(Replace(myName, myext, ""), "__", , vbTextCompare)(0)
ActiveDocument.SaveAs2 FileName:=ActiveDocument.Path & Application.PathSeparator & myNName & "__" & Format(Now(), "yyyy-mm-dd_hh-mm-ss") & ".docm", _
FileFormat:=wdFormatXMLDocumentMacroEnabled, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False, CompatibilityMode:=14
SetAttr myOld, vbNormal
Kill myOld
End Sub
Ciao, in questi giorni ho provato la macro che mi hai gentilmente segnalato e su win funziona correttamente.
Mentre su mac non c'è verso..
attraverso il debug mi indica il problema in questa stringa di codice qua:
ActiveDocument.SaveAs2 FileName:=ActiveDocument.Path & Application.PathSeparator & myNName & "__" & Format(Now(), "yyyy-mm-dd_hh-mm-ss") & ".docm", _
FileFormat:=wdFormatXMLDocumentMacroEnabled, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False, CompatibilityMode:=14
Purtroppo le mie scarse conoscenze in materia mi rendono difficile individuare il problema (ho provato a cambiare tipo estensione ma niente).
In ogni caso di nuovo grazie mille per l'aiuto ed i suggerimenti.