Could someone tell me how to create a new document in a database and apply a form to it, when using COM?
Example:
Dim $n = ObjCreate(“Lotus.NotesSession”)
Dim $db = ObjCreate(“Notes.NotesDatabase”)
Dim $doc = ObjCreate(“Notes.NotesDocument”)
$n.Initialize(“my password goes here”)
$db = $n.GetDatabase(“server/org”, “dbname.nsf”)
$doc = $db.CreateDocument()
Now, I want to apply a form to $doc.
I’m unable to utilize $doc.Form = “name of form”. I can’t see any other way to apply a form to my new document (or create a document directly with the form).
I’m trying to achieve the equivalent of @Command([Compose]);“my form name”
but even Evaluate seems to be failing for me.
I tried
$result = $n.Evaluate("@Command([Compose]);“my form name”, $doc)
‘requested action with this object has failed’…
Any help on how to apply a form on a document through COM by either method would be greatly appretiated…
Thanks in advance,