Deletion of Notes Template from Local drive

Hi,

Recently i’m confronting with a typical situation where i have made a template from a Notes Database and saved that in Local Drive (for eg. C:\Template), a situation where i have to attach this template to a document and then delete the template from local drive is creating problem, i’m able to attach the template but while deleting the template i’m considering it as file and trying to Kill it but it is not.

Is there any way to delete this file(ntf) from local drive? Prompt solution will be highly appreciated.

Regards

Vijay Baswal

Subject: Deletion of Notes Template from Local drive

Hi,

Using LotusScript you can delete a database or template through the Lotus Notes session interface. Try something like this:

Dim session As New NotesSession

Dim template AsNotesDatabase

Set template = session.GetDatabase(“”,“templatename.ntf”,False)

template.Remove

Hope this help.

Subject: RE: Deletion of Notes Template from Local drive

Hi Guillaume,

I’m using Lotus script to perform all this activity and my problem is that the ntf that is made from nsf is saved at my local drive and i have to delete it from there not from the server using session.

If you have any solution do respond me.

Regards

Subject: RE: Deletion of Notes Template from Local drive

The GetDatabase method can be used to retrieve local database also, so this should work. The only restriction is that the template file needs to be located in the lotus Notes data directory. Otherwise, have you tried using the instruction “Kill filename”, it should work with any file. Verify that the file you try to kill is not opened by your program, force it to close the file.

Subject: RE: Deletion of Notes Template from Local drive

Kill will do it, but not if the file is still in use. You have probably encountered a “race condition” – your code isn’t finished with the file before you try to delete it. Try adding a Sleep before the Kill.