I am trying to import an email from the mailbox into a form in another database. I am able to get the sendto, copyto, and other fields. But I am not able to get the body field which is rich text. Does anyone know how to get the Body (rich text field) by using the formula language?
Here is my code:
REM {Variables};
tRepID := “85256498:007255BE”;
tView := “($Users)”;
tView1 := “(CMSII Lookup 2)”;
tView2 := “(CMSII Lookup)”;
tKey := @UserName;
REM {Get the mailfile name};
tMailFile := @DbLookup(“”: “NoCache”; tRepID; tView; tKey; 7);
@SetField(“Mail”; tMailFile + “.nsf”);
@Command([ViewRefreshFields]);
REM {Now I need to have a picklist so the user can select which email to copy over};
tMessage := @PickList([Custom] : [Single]; “Domino” : Mail; tView2; “Select Item to Import”; “Please select the message that you want to import into this document:”; 13);
REM {Get the data from the email that is needed};
To := @DbLookup(“” : “NoCache”; “Domino” : Mail; tView1; tMessage; “SendTo”);
CC := @DbLookup(“” : “NoCache”; “Domino” : Mail; tView1; tMessage; “CopyTo”);
BCC := @DbLookup(“” : “NoCache”; “Domino” : Mail; tView1; tMessage; “BlindCopyTo”);
Subject := @DbLookup(“” : “NoCache”; “Domino” : Mail; tView1; tMessage; “Subject”);
PostedDate := @DbLookup(“”: “No Cache”; “Domino” : Mail; tView1; tMessage; “PostedDate”);
REM {Can not get this into the form. Same field name and everything as the memo in the mailbox};
Body := @DbLookup(“”: “No Cache”; “Domino” : Mail; tView1; tMessage; “Body”);
REM {Set the fields in the memo in the CMSII};
@SetField(“SendTo”; To);
@SetField(“CopyTo”; CC);
@SetField(“BlindCopyTo”; BCC);
@SetField(“Subject”; Subject);
@SetField(“Body”; Body);
@SetField(“PostedDate”; PostedDate);
@Command([ViewRefreshFields])
Thanks,
Jamie