Jump to content

Uba

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by Uba

  1. okay so i have figured something out, the only problem is that you need outlook installed and configured with a profile. still working on a standalone solution.

    public static IEnumerable<MailItem> readPst(string pstFilePath, string pstName)
            {
                List<MailItem> mailItems = new List<MailItem>();
                Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();
                NameSpace outlookNs = app.GetNamespace("MAPI");
                // Add PST file (Outlook Data File) to Default Profile
                outlookNs.AddStore(pstFilePath);
                Microsoft.Office.Interop.Outlook.MAPIFolder rootFolder = outlookNs.Stores[pstName].GetRootFolder();
                // Traverse through all folders in the PST file
                // TODO: This is not recursive, refactor
                Folders subFolders = rootFolder.Folders;
                foreach (Folder folder in subFolders)
                {
                    Items items = folder.Items;
                    foreach (object item in items)
                    {
                        if (item is MailItem)
                        {
                            MailItem mailItem = item as MailItem;
                            mailItems.Add(mailItem);
                        }
                    }
                }
                // Remove PST file from Default Profile
                outlookNs.RemoveStore(rootFolder);
                return mailItems;
            }

    This code will retrieve all mailitems inside the pst file.

  2. I have been trying to write a c## console app/excel macro/batch to go out and acquire and catalog meta titles based off an imputed URL, into an excel/XML/access database. I have little experience with cataloging in this way. But never the less I an currently tasked with cataloging 6000+ URLs into an excel spread sheet. I have tried to write it my self, but i mainly get suck trying to figure out how to get it to go to a URL, then pull off Meta titles (which I'm not even sure how to get to)and then place then into a sting in order to output the meta titles into a database. I truly would like to not manually type out 100,000's of meta titles so any help, recommendations, or comments are greatly appreciated.

    thank you,

    Schloobydooby

    I think the best way to go about this is to use httpwebrequest & Response to get the entire code of a webpage, after that use regex or algorithims to parse the tags of the code you've retrived, on that note you may be able to place the code in an new htmlDocument and retrive the tags that way too, as for the database it really isnt that hard although i would suggest sql or mysql(access might work too), it is easyier to manage. then export into excell or csv and manipulate to your liking.

  3. Does anyone know how to parse PST files please? I would like reliable information in relation to the PST file structure. Any resources or documentation source/s would be greatly appreciated. I've tried Googling and all that jazz but nothing useful. I need the structure rather than reading the content as this will at some point be incorporated into an application which needs to extract all emails and their attachments.

    Thanks in advance

    Dave

    Much agreed, if anyone out there has any information on parseing pst files for the use of extracting emails and attachements please post!.

×
×
  • Create New...