Thanks a lot for your help!
It simply doesnt start as I dont know how to instantiate the clas
module. I tried like this:
Dim myOlApp As Outlook.Application
Public WithEvents myOlItems As Outlook.Items
Private Sub Class_Initialize()
Set myOlItems
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
End Sub
Private Sub myOlItems_ItemChange()
Dim myOlMItem As Outlook.MailItem
If MsgBox("Sicronizar con Base de Datos?", vbYesNo + vbQuestion)
vbYes Then
'inicio de comparacion con datos del Access
End If
End Sub
I've never worked with class modules, so how do I instantiate it?
Thanks a lot,
Val
What in particular doesn't work? Please take the time to quote the =
original message so that people reading your current response can =
understand what you're talking about. Otherwise, you may not receiv
the =
answer you're looking for.=20
This is in a class module, right? How are you instantiating the class
=
Yes, you definitely need to either call the Initialize_handle
procedure =
or use code in the Class_Initialize event handler.=20
--=20
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at
http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx=20
valib said:
=20
Thank you for your answer!
I know programmed the following:
=20
Dim myOlApp As Outlook.Application
Public WithEvents myOlItems As Outlook.Items
=20
Public Sub Initialize_handler()
Set myOlItems =3D
myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
End Sub
=20
Private Sub myOlItems_ItemChange()
If MsgBox("Sicronizar con Base de Datos?", vbYesNo + vbQuestion) =3D
vbYes Then
'inicio de comparacion con datos del Access
End If
End Sub
=20
why does it not work? Maybe i have to call the initialize_handler
before? If yes, how can I do this?
=20
Thank you
=20
=20
You can use the MAPIFolder.Items.ItemAdd and .ItemChange events wit
the =
MAPIFolder object pointing to your Contacts folder.=20
--=20
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at
http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx=20