Re: [Dialog] Please help with script



*Jarrod Cifer*, 4 Sep. 05, 10:01:

> Nice! Do you mind if I put this in the script library?

If you do, please use this slightly modified version which fixes a problem
with emails without a subject header, works with "Re: ..." is a bit more
optimized.


program OnBeforeSavingMessage;

const NameofList = '['+'Type the Name of the List Here'+']';

procedure OnBeforeSavingMessage(var Message: TStringlist;
Servername: string;
IsEmail: boolean);
var
i,p: integer;
Soggetto: string;
begin
if IsEmail then begin
for i:=0 to message.count-1 do begin
if copy (message[i], 1, 9)='Subject: ' then begin
p := pos (NameofList, message[i]);
if p > 0 then begin
Soggetto := message[i];
delete (Soggetto, p, Length(NameofList));
message[i]:=Soggetto;
end;
break;
end
else if message[i]='' then break;
end;
end;
end;

begin
end.


Marcus
--
No replies in private e-mail, please, unless explicitly requested!
Please log bug reports into Mantis: http://www.40tude.com/dialog/mantis/
Please share your scripts and tips: http://www.40tude.com/dialog/wiki/
.



Relevant Pages

  • Re: Large text file import: MVP question
    ... Simple solutions give fast processing ... One thing you have to keep in mind. ... througput time than from the basic Net namespace. ... change, with mid, split, tolower, or whatever will result in a new string. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FEATURE SUGGESTION: Accept default value for to_f and to_i
    ... does string to number conversions, eg. a SQL results to a Fixnum. ... would come a close second best in my mind). ... configuration where you are reading a value from a string source eg. xml ... In that example, you asked for a nil default, and thats what you got. ...
    (comp.lang.ruby)
  • Re: IsDate("ISomeTimesHateProgrammingMarch2005") = True
    ... You are (to my mind) quite right to be puzzled. ... This string isn't ... English phrase' has a meaning or effect completely different than the ...
    (microsoft.public.dotnet.languages.vb)
  • [patch 20/22] macfb: Do not overflow fb_fix_screeninfo.id
    ... Don't overflow the 16-character fb_fix_screeninfo id string (fixes some ... console erasing and blanking artifacts). ...
    (Linux-Kernel)
  • Re: Error 91
    ... NOT reccomend showing the standard error box to a user that can create major ... > I am using a piece of vba code to 'Find' a cell containing a string. ... > dialog that Excel displays, when the data is not found, when doing the Find ... >> When you lose your mind, ...
    (microsoft.public.excel.programming)