AddItem not firing on Public Folder

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top