Board index » delphi » Outlook - Getting mail messages out of folder NOT default inbox

Outlook - Getting mail messages out of folder NOT default inbox

I have a client who receives orders by email. He sends them
to the inbox\orders folder

My app nees to pick them up in the sub-folder(ie orders folder) and
not the inbox.

Is there any way to do this  - any help much appreciated !

Thanks
Luke Grews

 

Re:Outlook - Getting mail messages out of folder NOT default inbox


<<Luke Grews:
My app nees to pick them up in the sub-folder(ie orders
folder) and not the inbox.

Quote

Use the Folders property of the Inbox folder to get the
subfolder, like this:

var
  MI: MailItem;
  Folder: MAPIFolder;
begin
  Folder := NmSpace.GetDefaultFolder(
              olFolderInbox).Folders.Item('SubFolder');
  MI := Folder.Items.Item(1) as MailItem;
  Caption := MI.SenderName + ' ' +              
DateToStr(MI.ReceivedTime);

--
Deborah Pate (TeamB) http://delphi-jedi.org

  Use Borland servers; TeamB don't see posts via ISPs
  http://www.borland.com/newsgroups/genl_faqs.html

Re:Outlook - Getting mail messages out of folder NOT default inbox


Hi Deborah

Thanks to you I can now enjoy my Christmas ! My client is happy and
so am I. Thanks so much for your solution !!

Cheers
Luke V.Grews

"Deborah Pate (TeamB)" <d.p...@cableinet.co.not-this-bit.uk> wrote in
message news:VA.00000664.00e721f1@cableinet.co.not-this-bit.uk...

Quote
> <<Luke Grews:
> My app nees to pick them up in the sub-folder(ie orders
> folder) and not the inbox.

> Use the Folders property of the Inbox folder to get the
> subfolder, like this:

> var
>   MI: MailItem;
>   Folder: MAPIFolder;
> begin
>   Folder := NmSpace.GetDefaultFolder(
>               olFolderInbox).Folders.Item('SubFolder');
>   MI := Folder.Items.Item(1) as MailItem;
>   Caption := MI.SenderName + ' ' +
> DateToStr(MI.ReceivedTime);

> --
> Deborah Pate (TeamB) http://delphi-jedi.org

>   Use Borland servers; TeamB don't see posts via ISPs
>   http://www.borland.com/newsgroups/genl_faqs.html

Other Threads