K
Kristy
Hi
I have created a com addin for Outlook 2000 and higher, and usually
run it with Exchange server.
My application currently performs certain functions on tagged items
that go into the sent items folder. However, since you can choose not
to save items to the sent items folder and can use the rules wizard to
save them elsewhere, I would like to be able to set up an ItemAdd
event for all folders. I don't want to do this manually as folders
are created and deleted so often I could never keep up, and often
there will be hundreds of folders to monitor, personal and public. If
I could set up a Folder Wrapper to handle events ie ItemsAdd etc on
any accessed folder it would be fab!
I have tried setting up a Folder Wrapper like the Explorer warapper in
the Itemscb example. I have already set up an Inspector wrapper based
on that but it took me such a long time to get that right and already
I am struggling with this that I am hoping that someone may take pity
on me and have some sample code of a Folder Wrapper for me to look
at???
If no code sample is available then here is handful of issues so far
that maybe you can help with. Basically I am having trouble knowing
how to declare things properly. This is what I have so far... I am
initalising gBaseclassFldr in the on_Connection event as follows:
gBaseClassFldr.InitHandlerFldr Application, AddInInst.ProgId
I have set up two class modules FldrOutAddin and FldrWrap and a module
modOutlFldr (as per ItemsCB). Now I need to instantiate a folder
collection declared withevents so that I can trap the events for the
folder.
In the FldrOutAddin class module I am using
Private WithEvents colFldr As Outlook.Items
but have no idea if this is correct and how do I then add folders to
the collection, do I use Outlook.MapiFolder eg:
Private Sub colFldr_NewFolder(ByVal Folder As Outlook.MapiFolder)
On Error Resume Next
gblnNewFldr = True
AddFldr Folder
End Sub
In the FldrWrap class I am declaring
Private gBaseClassFldr As New FldrOutAddin
Private WithEvents m_objFldr As Outlook.Items
Again is this correct and then how do I use this? I can't declare them
as MapiFolder so I think I'm just missing the point or really confused
:-(
Public Property Let Folder(objFolder As Outlook.Items)
Set m_objFldr = objFldr
End Property
Public Property Get Folder() As Outlook.Items
Set Folder = m_objFldr
End Property
I hope that someone can offer some insight.
Cheers
Kristy
I have created a com addin for Outlook 2000 and higher, and usually
run it with Exchange server.
My application currently performs certain functions on tagged items
that go into the sent items folder. However, since you can choose not
to save items to the sent items folder and can use the rules wizard to
save them elsewhere, I would like to be able to set up an ItemAdd
event for all folders. I don't want to do this manually as folders
are created and deleted so often I could never keep up, and often
there will be hundreds of folders to monitor, personal and public. If
I could set up a Folder Wrapper to handle events ie ItemsAdd etc on
any accessed folder it would be fab!
I have tried setting up a Folder Wrapper like the Explorer warapper in
the Itemscb example. I have already set up an Inspector wrapper based
on that but it took me such a long time to get that right and already
I am struggling with this that I am hoping that someone may take pity
on me and have some sample code of a Folder Wrapper for me to look
at???
If no code sample is available then here is handful of issues so far
that maybe you can help with. Basically I am having trouble knowing
how to declare things properly. This is what I have so far... I am
initalising gBaseclassFldr in the on_Connection event as follows:
gBaseClassFldr.InitHandlerFldr Application, AddInInst.ProgId
I have set up two class modules FldrOutAddin and FldrWrap and a module
modOutlFldr (as per ItemsCB). Now I need to instantiate a folder
collection declared withevents so that I can trap the events for the
folder.
In the FldrOutAddin class module I am using
Private WithEvents colFldr As Outlook.Items
but have no idea if this is correct and how do I then add folders to
the collection, do I use Outlook.MapiFolder eg:
Private Sub colFldr_NewFolder(ByVal Folder As Outlook.MapiFolder)
On Error Resume Next
gblnNewFldr = True
AddFldr Folder
End Sub
In the FldrWrap class I am declaring
Private gBaseClassFldr As New FldrOutAddin
Private WithEvents m_objFldr As Outlook.Items
Again is this correct and then how do I use this? I can't declare them
as MapiFolder so I think I'm just missing the point or really confused
:-(
Public Property Let Folder(objFolder As Outlook.Items)
Set m_objFldr = objFldr
End Property
Public Property Get Folder() As Outlook.Items
Set Folder = m_objFldr
End Property
I hope that someone can offer some insight.
Cheers
Kristy