Template Collection Agent

I have to develop an agent which have to collect all the Templates on each server. I am storing all the Server Names in a View by name “Server Names” and I am accessing the Server Name one by one and I am accessing all the Templates which is on that server. But some templates are missing when I am doing with the following script.

Following is the Script which I’m using.

Sub Initialize

Dim Session As New NotesSession

Dim ThisDb As NotesDatabase

Dim TempDb As NotesDatabase



Dim DbDir As NotesDbDirectory

Dim ServerView As NotesView

Dim ServerDoc As NotesDocument

Dim Doc As NotesDocument

Dim ServerName As String

Dim ServName As NotesName



Set ThisDb = Session.CurrentDatabase

Set ServerView = ThisDb.GetView("Server Names")

Set ServerDoc = ServerView.GetFirstDocument



While Not ServerDoc Is Nothing

	

	Set ServName = Session.CreateName(ServerDoc.ServerName(0))

	ServerName = ServName.Abbreviated

	

	Set DbDir = Session.GetDbDirectory(ServerName)

	Set TempDb = DbDir.GetFirstDatabase(1248)

	

	While Not  TempDb Is Nothing

		Set Doc = ThisDb.CreateDocument

		Doc.Form = "Tmpl Collection Form"

		

		Doc.Title = TempDb.Title 

		Doc.Server = TempDb.Server

		Doc.FilePath = TempDb.FilePath

		Doc.RepID = TempDb.ReplicaID

		Doc.TemplateName = TempDb.DesignTemplateName

		

		Call Doc.Save(True,False)

		Set TempDb = DbDir.GetNextDatabase

	Wend	

	Set ServerDoc = ServerView.GetNextDocument(ServerDoc)

Wend

End Sub

Could any one help me to get all the templates.

Thanks In Advance

Subject: Template Collection Agent

That code will only get you NTFs. It is possible for an NSF to be a template as well. Are the missing ‘templates’ NSFs?

Subject: RE: Template Collection Agent

That agent will get only templates.And I need only templates.I do not want any of the NSFs. The missing files are templates only. I need to get those also…