Public
WithEvents
app
As
Application
Private
Sub
app_DocumentBeforeSave(
ByVal
Doc
As
Document, SaveAsUI
As
Boolean
, Cancel
As
Boolean
)
Dim
Pfad
As
String
If
WINorMAC =
"Win"
Then
If
Doc.AttachedTemplate.Name =
"Vorlage Protokoll_neu.dotm"
Then
ActiveDocument.RemoveDocumentInformation wdRDITemplate
End
If
Else
Pfad = Word.Application.NormalTemplate.Path &
"/Normal.dotm"
With
ActiveDocument
.UpdateStylesOnOpen =
False
.AttachedTemplate = Pfad
End
With
End
If
End
Sub
Function
WINorMAC()
If
Not
Application.System.OperatingSystem
Like
"*Mac*"
Then
WINorMAC =
"Win"
Else
WINorMAC =
"Mac"
End
If
End
Function