It looks like you're new here. Sign in or register to get started.
fctCopyAttachments(ptxtID : Text[250];ptxtDirectory : Text[250];VAR pintNumberOfMails : Integer) //fctCopyAttachments olMapiFolder := olNameSpace.GetFolderFromID(ptxtID); ltxtFindCriteria := '[Subject] = ''All mails containing this text'''; olItems := olMapiFolder.Items.Restrict(ltxtFindCriteria); //Save attachments to directory i := 1; lintEndOfLoop := olItems.Count; WHILE i <= lintEndOfLoop DO BEGIN olMItem := olItems.Item(i); olAttachments := olMItem.Attachments; IF olAttachments.Count = 1 THEN BEGIN olAttachment := olAttachments.Item(1); olAttachment.SaveAsFile(ptxtDirectory + '\' + olAttachment.FileName); END; i := i + 1; END; pintNumberOfMails := lintEndOfLoop; CLEAR(olItems); CLEAR(olMItem); CLEAR(olAttachments); CLEAR(olMapiFolder);
fctMove2Folder(ptxtID : Text[250];ptxtID2 : Text[250]) //fctMove2Folder olMapiFolder := olNameSpace.GetFolderFromID(ptxtID); olMapiFolder2 := olNameSpace.GetFolderFromID(ptxtID2); ltxtFindCriteria := '[Subject] = ''All mails containing this text'''; olItems := olMapiFolder.Items.Restrict(ltxtFindCriteria); FOR i := 1 TO olItems.Count DO BEGIN olMItem := olItems.Item(i); olMItem.Move(olMapiFolder2); CLEAR(olMItem); i := 999999; END; CLEAR(olItems); CLEAR(olMItem); CLEAR(olMapiFolder); CLEAR(olMapiFolder2);
Answers
What have you tried yourself? Is your solution 95% finished or are you hoping for a free-of-charge solution.
Personaly I would not interface with outlook but directly with exchange via the NAS.
It wil help if you post the code.
Do you use a dedicated mailbox for this solution? That usually helps so you can just process al emails that enter the inbox.
This function moves mails from one Outlook folder to another OL folder:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Regards
Rakesh Ranjan