The Mail Codeunit and the MsgNoteText problem

Did anyone find a usable solution to the MAPIMessage.MsgNoteText with messages longer than 250 characters? The only solution I can see right now is the array solution:


i := 0;
r.FIND('-');
REPEAT
  i += 1;
  msgArray<i> := r.Text;
UNTIL r.NEXT = 0;

CASE i OF
  1 : MAPIMessage.MsgNoteText = msgArray[1];
  2 : MAPIMessage.MsgNoteText = msgArray[1] + msgArray[2];
  3 : MAPIMessage.MsgNoteText = msgArray[1] + msgArray[2]+ msgArray[3];
</i>

But this solution is really not very flexible or usable if you have long emails. Best regards, [i]Erik P. Ernst, webmaster Navision Online User Group

r.reset r.FIND(’-’); MAPIMessage.MsgNoteText := ‘’; REPEAT MAPIMessage.MsgNoteText := r.text; until r.next = 0; MAPI INCREASE TEXT AUTOMATICALY.

It sounded too good to be true. And all my test shows that it is. At least here on my end. So I’m back to the beginning. Best regards, Erik P. Ernst, webmaster Navision Online User Group

quote:


It sounded too good to be true. And all my test shows that it is.


Tests showed that it is True? But in this case you wouldn’t be back to the beginning. So what? ------- With best regards from Switzerland Marcus Fabian

What version of Navision did you test it? Best regards, Erik P. Ernst, webmaster Navision Online User Group

Ok, as moderator in this forum i could be stopping this But i am sure you two, Fabian and Erik, can work this out. Erik: Try and re-read the posting by Fabian :-). Soren Nielsen, moderator Integration/Developer NOLUG

In codeunit 397 we create a new funcion based on 2nd funcion, with multiple copies to and multiple text lines:

//IGR 060400. SE INCORPORA FUNCIONALIDAD A MÚLTIPLES COPIAS DE CORREO.
COMPRESSARRAY(CCNombre);
FOR I:= 1 TO ARRAYLEN(CCNombre) DO 
  BEGIN
    IF CCNombre[I] <> '' THEN BEGIN
      MAPIMensajes.RecipIndex := MAPIMensajes.RecipCount;
      MAPIMensajes.RecipType := 2;
      MAPIMensajes.RecipDisplayName := CCNombre[I];
    END;
  END;
//FIN

It’s implemented in version ES2.00 and ES2.60 Edited by - SNielsen on 2001 Mar 29 09:42:25

Ehhh, aahh. I think I forgot a NOT TRUE. What I ment to write was that according to my tests it didn’t work. It wasn’t true. Sorry about that. So I’m still looking for suggestion on this. My client uses NF 2.00.D. Best regards, Erik P. Ernst, webmaster Navision Online User Group

Ok. I Only use it in MAPIMensajes.RecipDisplayName and in MAPIMensajes.MsgNoteText with array variable 10250 and ccnombre array 1080, but when MAPIMensajes.MsgNoteText is greater than 512 crash function. You can use it: R.RESET; IF R.FIND(’-’) THEN REPEAT MAPIMensajes.MsgNoteText := FORMAT(MAPIMensajes.MsgNoteText) +R.Texto; UNTIL R.NEXT = 0;