With a bit of help I've found an answer:
If IO.Path.GetExtension(strTemplateFilename) = ".dotx" Or IO.Path.GetExtension(strTemplateFilename) = ".dotm" Then
IO.File.SetAttributes(strTemplateFilename, IO.FileAttributes.ReadOnly)
End If
It seems very obvious now!
|