Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi All.
It's a long time since I've posted on here. I hope someone can help me with the following: We regularly save batches of e-Mails received via Outlook onto our network drive as .msg files. This saves having one big .pst file that only one person can open and navigate at any one time. Also we have this (rather arcane, I know) requirement to save them in what the big chiefs call a "day file". Yeah, I know. Went out with the ark. Or should have done. What I want to do though is write a routine which automatically looks for an older message to link a newer message to if it contains a reply to that older message. For that bit, I already have the routine. Also, I want to check the attachments within it and use a combination of the date sent of the e-Mail and the Date Last Modified of the attachments to work out where in the document workflow that particular e-Mail in/out sits. Again, I have all the algorithm to do that worked out. HOWEVER - what I need to be able to do is access the previously saved .msg files as MailItem objects. So that I can read the sent date/time, recipient list properties and so on. This is where I'm stuck. The only way so far I have been able to convert .msg files into MailItem objects is to do the following: tFilename = "N:\My e-Mail.msg" Set xItem = Application.CreateItemFromTemplate(tFilename) However what this returns is a MailItem object for an un-sent COPY of the message. Therefore, trying to read the .SentOn property returns an error because the mail item isn't sent. Opening the MailItem object for display shows the message as an editable copy as you would expect. This of course is no good to me as what I want to be able to do is operate on these files, give the user the option to display them if necessary, with all sending information in the headers intact both as visual proof of successful transmission and so I can work on it in my macro. BTW I also tried: Call Application.CopyFile ("N:\my e-Mail.msg","Inbox") ...which 'sort of' works - i.e. it imports the .msg file into the Inbox folder - but again, it is reported only as a generic file "Item" - NOT a "MailItem". So again, trying to access any mail-send related properties fails - i.e. you can't access any .To or .SentOn properties, etc. In essence, the Item is viewed by Outlook merely as a 'document' of type .msg. So, is there any OTHER way of importing an .msg file back into a MailItem object or importing it into a MAPI folder so that I can read it from the MailItem collection in that folder? That would be the final piece of my puzzle. Thanks tremendously to anyone who can come up with the answer to this! Mark London Last edited by BizMark : July 28th 08 at 12:58 PM |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating an Outlook Task Item | Excel Discussion (Misc queries) | |||
E-Mail attachment to same e-mail address in Outlook | Excel Discussion (Misc queries) | |||
.xls files become scrap objects - .shs files | Excel Discussion (Misc queries) | |||
IF function for scheduling tool with outlook integration | Excel Worksheet Functions | |||
Outlook Integration | Excel Discussion (Misc queries) |