View Single Post
  #3  
Old November 1st 06, 04:40 PM posted to microsoft.public.outlook.program_vba
Catalin
external usenet poster
 
Posts: 15
Default Moving sent items instead of copying them to "Sent items" fold

Yes the code is in the ThisOutlookSession class module. The macros are
enabled as well.

I will try your suggestion and come back to you.

Thanks for your answer.
Catalin


"Ken Slovak - [MVP - Outlook]" wrote:

This code is in the Outlook VBA project, in the ThisOutlookSession class
module? If so move the initialization code to Application_Startup and see
what happens. Are macros enabled or disabled for your setup?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Catalin" wrote in message
...
Dear Friends,

Please help me with this problem:
I use OL 2003 and I need to move the sent items based on the acoount
through
which they are being sent. I have to mention that I have 3 accounts as
well.
I have a code which is presented below but it doesn't seem to work.

Option Explicit

Public WithEvents SentItemsAdd As Items

Private Sub Application_MAPILogonComplete()
Set SentItemsAdd =
Application.GetNamespace("MAPI").GetDefaultFolder( olFolderSentMail).Items
End Sub

Private Sub SentItemsAdd_ItemAdd(ByVal Item As Object)
If Item.SenderEmailAddress = " Then
Dim oSubFolder As Outlook.MAPIFolder
Set oSubFolder =
Application.GetNamespace("MAPI").Folders.Item("wor k2006").Folders.Item("Sent
Items")
Item.Move oSubFolder
Set oSubFolder = Nothing
End If

If Item.SenderEmailAddress = " Then
Dim oSubFolder As Outlook.MAPIFolder
Set oSubFolder =
Application.GetNamespace("MAPI").Folders.Item("sal esl2006").Folders.Item("Sent
Items")
Item.Move oSubFolder
Set oSubFolder = Nothing
End If

'and so on

End Sub

The event is not triggered.

Can somebody help?

Thanks in advance,
Catalin



Ads