![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi guys,
I have a macro that will move all email sent with "sendonbehalf" properties to the group mailbox. I found it on someone post and it has been working like a charm until I installed Office SP2. It doesn't work anymore. Do anyone might know what is the issue? I have try re-install Office then also SP2 with no joy. Below is the code Private SentEntryID As String Private SentStoreID As String Private WithEvents objSentItems As Items Private MailItem As Outlook.MailItem Public Sub Application_Startup() 'Retrieve ID for accessing non-default sent folder getStoreFolderID ("Mailbox - group") Set objSentItems = Application.Session.GetDefaultFolder(olFolderSentM ail).Items End Sub Function getStoreFolderID(StoreName) 'Gets the Shared Account Sent Folder Dim Store As Object Dim StoreFolder As Object Dim i As Integer Set Store = Application.GetNamespace("mapi").Folders For Each StoreFolder In Store If StoreFolder.Name = StoreName Then For i = 1 To StoreFolder.Folders.Count If StoreFolder.Folders(i).Name = "Sent Items" Then SentEntryID = StoreFolder.Folders(i).EntryID SentStoreID = StoreFolder.Folders(i).StoreID Exit For End If Next Exit For End If Next Set Store = Nothing Set StoreFolder = Nothing End Function Private Sub objSentItems_ItemAdd(ByVal Item As Object) 'Fired when something is added to personal "Sent Mail" folder If TypeOf Item Is Outlook.MailItem Then With Item Set MailItem = Application.GetNamespace("mapi").GetItemFromID(.En tryID, ..Parent.StoreID) End With If MailItem.SentOnBehalfOfName = "group" Then Set DestinationFolder = Application.Session.GetFolderFromID(SentEntryID, SentStoreID) MailItem.Move (DestinationFolder) End If End If Set MailItem = Nothing End Sub Any suggestion or thinking are welcomed. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2007 no longer installed after SP2 2007 Office Suites upda | PGP | Outlook - Installation | 2 | May 1st 09 12:16 PM |
Since we installed Office 2007, Outlook 2003 no longer runs | JacquesT | Outlook - General Queries | 1 | January 27th 09 08:17 PM |
SoundMAX audio no longer loads under Office 2007 install? | JVRudnick | Outlook - General Queries | 1 | January 3rd 08 06:34 PM |
can't uninstall 2007 Trial to install Office 2007 | Christopher Glaeser | Outlook - Installation | 0 | February 16th 07 04:29 AM |
outlook did not install with office 2007 | FufkinPro | Outlook - Installation | 3 | January 18th 07 10:35 PM |