AddItem not firing on Public Folder

  • Thread starter Thread starter freeman642
  • Start date Start date
F

freeman642

I have a public folder that any email that gets dropped into the
folder gets processed a variety of ways. I cannot get the addItem to
fire. My code is below, no error just doesnt fire. Any ideas it is
driving me crazy!

Thanks John


Public Sub Application_Startup()


Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim AutoTBNTTop As Outlook.MAPIFolder
Dim AutoTBNTFolder As Outlook.MAPIFolder


Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
Set AutoTBNTTop =
myNamespace.GetDefaultFolder(olPublicFoldersAllPublicFolders)
Set AutoTBNTFolder = AutoTBNTTop.Folders("FolderName")
Set AutoItems = AutoTBNTFolder.Items


End Sub


Private Sub AutoItems_ItemAdd(ByVal Item As Object)


ThanksButNoThanks


End Sub
 
Are you sure you have permissions on that Public Folder? Is the
AutoTBNTFolder object returning the folder you expect? You might want to try
using the GetFolderFromID method instead.

Also, you don't need to create an Application object - there's an intrinsic
object using that same name that's available to use, and deriving objects
from it will not generate any security prompts in OL2003.
 
Back
Top