Cannot locate form memo

I want to create a new notes notesdatabase and copy all selected mails by user to the newly created database. I am able to create database with documents but when I open the database I get a message “Cannot located form Memo”, “Cannot locate default document”.

Here is the lotus script code

Sub CreateDBFromSelDoc

Dim strdbName As String 

Dim doc As NotesDocument 

Dim destDoc As NotesDocument 

Dim dbSelected As New NotesDatabase("","")



strdbName = "test" 

strdbName = "C:\ExpDB\" & strdbName & ".nsf"

	

Set collection = db.UnprocessedDocuments 





Call	dbSelected.Create("",strdbName,True)

dbSelected.Title = "Test DB"



Set doc = collection.GetFirstDocument 



While Not (doc Is Nothing)

	Set destDoc = doc.CopyToDatabase(dbSelected)

	Set doc = collection.GetNextDocument (doc)

Wend

End Sub

Note: Some of the variables used in this method are declared globally.