Outlook Object Model - Detecting Mailboxes

后端 未结 1 460
渐次进展
渐次进展 2021-01-28 19:25

I have a Delphi 2006 BDS application with the following code to iterate outlook mailboxes and then the Inbox and Sent Items within the mailbox:

  try
    nameSpa         


        
相关标签:
1条回答
  • 2021-01-28 19:43

    In Outlook folders can be typed and have a DefaultItemType property. Replacing

    if Pos('MAILBOX', UpperCase(mailbox.Item[i].Name)) > 0 then
    

    with

    if (mailbox.Item[i].DefaultItemType = olMailItem) then
    

    should give you the folders that by default store only mail messages.

    Mail messages can of course be stored in untyped folders as well, but as olMailItem has

    olMailItem = $00000000;
    

    as its value, it is the default for all untyped folders as well. So basically any untyped folder by default stores mail items.

    0 讨论(0)
提交回复
热议问题