Results 1 to 1 of 1
2011-08-30, 15:44 #1
- Join Date
- Mar 2008
- Thanked 0 Times in 0 Posts
help selecting emails outlook 2007
The company I work for uses and exchange form of email archiving. A number of people have access to a shared mailbox that does not belong to any specific user. The mailbox is sort of a catch all for various reports coming in. Due to the number of reports, we have set up several auto rules that move emails from the inbox to the final archive folders. Once the auto rule moves these emails, they seem to get archived fairly quickly.
Since I try to use Excel to pull various emails from the mailbox and parse the data contained within them. I need to have the emails in and un-archived state in order to grab attachments from those emails. If the email is archived before I can get to it. The attachments when stripped have a different file name, always "EAS" and the files are empty. We have a toolbar / command bar called Archive with an option to restore an archived email. If a user manually clicks this button, the email can be restored from the exchange server so a user can use VBA to grab the attachments from the email.
What I'm hoping to do is by looping through all the emails in a folder, find the correct email. Then check the attachments to see if they show the display name of "EAS". This would tell me that it's archived. The problem I'm running into is that when I attempt to use the explorer to access the "Archive" command bar and execute the control for "restore". This function works on the email that is currently highlighted. It doesn't work on the email that the loop has found matching the subject and received time I'm looking for. Is it possible, once I've identified a specific mail items in a folder to have outlook physically select this mail item as if I single clicked on it? I'm a little stumped on how to physically select it using VBA. I've tried to activate it using the inspector as well as to display it, but it doesn't seem to work. The command bar only restores the item that is physically selected from the window. Or if there are any other suggestions for re-storing an archived email so I can get at the attachments. I'm open to those suggestions. Thanks!