I am making modifications to the memo form in the Notes mail template.
At the "QuerySend" event, I call a sub which takes the text from the body field and searches it for a particular string.
However, if the email in question is a forward, the text returned is only whatever is above the forwarded message. The text from the original email, which is being forwarded, is not returned by NotesUiDocument.fieldgette
The problem is that many of our users forward an email, but before sending, hack the email to bits and often type below the "forwarded by...." line. If they do this, I can't search their text as it isn't returned.
I imagine the answer would be to get the backend document and take the body item that way, however, at the point of QuerySend, there is no back document. I do not want to save the source at that point in case the user cancels the send of the email (ie when spellcheck triggers) and then end up not sending it.
I can't do this check in any event triggered after QuerySend because as far as I'm aware, this is my last chance to edit the uidoc contents before it becomes read only.....
I have attached the code, so you can see what I'm doing. The code is the sub that is being called at QuerySend.
The If Instr(1, body...) code is not the problem, because if I use a MsgBox to display the string item "body", it returns anything above the forwarded line.
Using something like notesdocument.fieldcontain
rstring") returns false if "whateverstring" is below the forward line.....
If anyone can help me get round this I'd be extremely grateful, I've been at this for ages and have got nowhere!
Would have assigned more points but I have only 75 left. Sorry
Sub ForceSignature(Source As NotesUIDocument)
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim ProfDoc As NotesDocument
Dim SigString As String
Dim Body As String
Body = source.FieldGetText("body")
Set ProfDoc = db.GetProfileDocument("CalendarProfile")
SigString = ProfDoc.Signature_3(0)
If Instr(1, body, "<<sig>>", 5)>0 Then
Call source.FindString("<<sig>>",False,False,False, False, False, False, True, True, True)