public static void Run()
{
// ExStart:ExtractNumberOfMessages
// The path to the file directory.
string dataDir = RunExamples.GetDataDir_Outlook();
// Load the Outlook file
string path = dataDir + "Sub.pst";
// Save message to file
using (PersonalStorage personalStorage = PersonalStorage.FromFile(path))
{
FolderInfo inbox = personalStorage.RootFolder.GetSubFolder("Inbox");
MessageInfoCollection messages = inbox.GetContents(10, 100); // Extracts messages starting from 10th index top and extract total 100 messages
}
// ExEnd:ExtractNumberOfMessages
}
}