View Single Post
  #1  
Old January 10th 07, 07:37 PM posted to microsoft.public.outlook.program_vba
Ron
external usenet poster
 
Posts: 128
Default How to Add a MailItem to a Folder

I have created a folder called "Forwarded" and I am using this code:

Private Sub outApp_NewMailEx(ByVal EntryIDCollection As String)
' Dim oFolder As MAPIFolder
' Set oFolder = GetNamespace("MAPI").GetDefaultFolder(olFolderInbo x)
Dim arr() As String
Dim i As Integer
Dim m As MailItem
On Error Resume Next
arr = Split(EntryIDCollection, ",")
For i = 0 To UBound(arr)
Set m = Application.Session.GetItemFromID(arr(i))
m.To = "
AddNewItemToFolder (m)
m.Send


Next

End Sub


Public Sub AddNewItemToFolder(oItem As MailItem)
Dim oFolder As MAPIFolder
Set oFolder = GetNamespace("MAPI").Folders.Item("Forwarded")
oFolder.Items.Add (oItem)
End Sub

But Even though I have a breakpoint in AddNewItemToFolder, I never get
there. It's as if the call to this subroutine were commented out.
Ads