Set s = New notessession
Set db = s.currentdatabase
'if this is a template then exit now
If db.templatename <> "" Then
Print "Agent is in a template"
End
End If
Warning: if the agent normally runs in a database with a tempate and you temporarily remove the template information for whatever reason, the agent will not run.