We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Default folders in PST

There are some predefined mapi folder types, so that it’s possible to know that (for example) ‘Deleted Items’ folder indeed contains deleted items.
I don’t see any way to fetch default folder(s) in your current API.
I cannot just take it ‘by name’ because it’s language dependent and also can be easily renamed.

Is there any workaround besides using the display name?

Thanks

Hi,

Thank you for inquiry.

We will look into it. I have added a new feature request for accessing the default folders (ID: 30243) and will update you when this feature becomes available.

Hi,

According to the format and specifications of the PST file, there are no default folders. MS Outlook itself creates some default folders like Inbox, Sent Items etc.

Since, we don’t know in advance the names of the folders, it is necessary to get these by calling PersonalStorage.RootFolder.GetSubFolders().

I've found this post on the internet:

http://www.pcreview.co.uk/forums/obtain-foldertype-folder-t1838223.html

A quote:

"It won't work for any non-default InfoStore. A brand new PST file has a Deleted Items folder but no Inbox. You can check for that.

The real way to do things isn't exposed in the Outlook object model. You would have to use CDO 1.21 or Extended MAPI. Assuming CDO 1.21 (an optional installation for Outlook 2000 and later) you would get the InfoStore. In the InfoStore is a property PR_IPM_WASTEBASKET_ENTRYID (property tag 0x35E30102) that has the EntryID of the default Deleted Items folder.

In a PST file that has been used to receive email and so has a full complement of default folders there are also PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_IPM_APPOINTMENT_ENTRYID, PR_IPM_CONTACT_ENTRYID, PR_IPM_DRAFTS_ENTRYID, PR_IPM_JOURNAL_ENTRYID, PR_IPM_NOTE_ENTRYID, PR_IPM_TASK_ENTRYID fields, located at either the InfoStore or InfoStore.RootFolder levels.
It won't work for any non-default InfoStore. A brand new PST file has a Deleted Items folder but no Inbox. You can check for that.

The real way to do things isn't exposed in the Outlook object model. You would have to use CDO 1.21 or Extended MAPI. Assuming CDO 1.21 (an optional installation for Outlook 2000 and later) you would get the InfoStore. In the InfoStore is a property PR_IPM_WASTEBASKET_ENTRYID (property tag 0x35E30102) that has the EntryID of the default Deleted Items folder.

In a PST file that has been used to receive email and so has a full complement of default folders there are also PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID, PR_IPM_APPOINTMENT_ENTRYID, PR_IPM_CONTACT_ENTRYID, PR_IPM_DRAFTS_ENTRYID, PR_IPM_JOURNAL_ENTRYID, PR_IPM_NOTE_ENTRYID, PR_IPM_TASK_ENTRYID fields, located at either the InfoStore or InfoStore.RootFolder levels."

The question is: can you reach this information or not?

Hi,

“It won’t work for any non-default InfoStore. A brand new PST file has a
Deleted Items folder but no Inbox. You can check for that.”

“Deleted Items” folder is required for a new PST file and only this folder is there when you create a new PST with Aspose.Email for .NET.

We will check the related posts and do some more analysis. I will update you when I have some feedback on this.

The issues you have found earlier (filed as 30243 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The default folders are accessible using StandardIpmFolder enum. Sample code:


FolderInfo folderInfo = pst.GetPredefinedFolder(StandardIpmFolder.SentItems);
MessageInfoCollection msgInfoColl = folderInfo.GetContents();
foreach (MessageInfo msgInfo in msgInfoColl)
{ …}