Hello,
I have the following Lotus Script:
Dim ssn As New NotesSession
Dim db As NotesDatabase
Set db = ssn.CurrentDatabase
…
Dim memo As NotesDocument
Dim body As NotesRichTextItem
Dim msg As String
Set memo = New NotesDocument(db)
Set body = New NotesRichTextItem(memo,“Body”)
memo.Form = “Memo”
memo.SendTo = docReq.FocalPt
memo.Subject = “…mail subject…”
…
Call memo.Send(False)
When I debug the above script, it stops at the “memo.Subject = …” line with the error message “Type mismatch”. I modified the same line to specify the first element, as follows:
memo.Subject(0) = …"
I get the error message “Invalid use of property”
Any suggestions on how to fix this error?
TIA,
Ped Perez/Austin/IBM
Subject: memo.Subject
Looks to me like the problem is with the line above- if “docReq” is declared and set as a document and “FocalPt” is a field then it should look like:
memo.SendTo = docReq.FocalPt(0)
Tom
Subject: RE: memo.Subject
Tom,
Thanks for the response. You are correct, docReq is a NotesDocument that is passed as an argument to the function. However, the type mismatch happens on the memo.Subject line and not in the “memo.SendTo = …”. Anyway, I tried your suggestion and I got the same type mismatch error.
Also, when I query the variables, the MEMO structure only shows 3 items, i.e. BODY, FORM and SENDTO.
Is there some limitations on having the problematic code in a function that is contained in the Script Libraries instead of inside the agent?
Thanks again,
Ped Perez
Subject: memo.Subject
Hi,
your code works fine for me…
Try deleting notes cache and/or copy/paste the code into a new agent(or whatever)…
Subject: RE: memo.Subject
Tom & Oliver,
I think I found the bug. The code originally says:
memo.Subject = “…some text…” + docReq.ReqNum(0)
of which I get “Type mismatch”. I changed the same line to:
memo.Subject = “…some text…” & docReq.ReqNum(0)
and it now works. The field docReq.ReqNum is numeric, so I’m guessing it was trying to add it to the literal string. The “&” fixed it.
Thanks for your help & suggestions.
Ped Perez