Results 1 to 8 of 8

Thread: Handle Events in Outlook 2003

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    5

    Unhappy Handle Events in Outlook 2003

    Hi All

    I need to add my own visual basic 6.0 code when, in Outlook 2003 Calendar, a new element is created or modified. Someone can help me, please??
    Please send me an e-mail to [email protected]
    Thanks in advance

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Handle Events in Outlook 2003

    Welcome to the Forums.

    You shouldnt post your email addy as you will get spammed alot. Members can email you through your profile contact info.

    Are these Private or Public Calendar items?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    5

    Re: Handle Events in Outlook 2003

    I'm sorry for email,
    regarding my request the Calendar Item is a Private Calendar Item.
    Thanks in advance

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Handle Events in Outlook 2003

    You can create two events for the ItemsAdd and ItemsChange for the particular calendar folder. Then in the events you cna do whatever.
    VB Code:
    1. Public WithEvents MyCalendarItems As Outlook.Items
    2. Public WithEvents MyOlApp As Outlook.Application
    3.  
    4. Private Sub Form_Load()
    5.     Set MyOlApp = GetObject(, "Outlook.Application")
    6.     Set MyCalendarItems = MyOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderCalendar).Items
    7. End Sub
    8.  
    9. Private Sub MyCalendarItems_ItemAdd(ByVal Item As Object)
    10.     '
    11. End Sub
    12.  
    13. Private Sub MyCalendarItems_ItemChange(ByVal Item As Object)
    14.     '
    15. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    5

    Re: Handle Events in Outlook 2003

    Hi, I copy Your code and paste it in the Outlook VBA project simply changing Form_Load with Application_Startup but it doesn't run.
    What I need is that when an element is created/opened must start my own code and when the item is saved another portion of my own code must be executed.

    Please help me soon :-(

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Handle Events in Outlook 2003

    No, it shouldnt be pasted in Outlook VBA as you stated you needed it in VB6.

    If you want to do it from VBA then make sure you have Macros enabled.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    5

    Re: Handle Events in Outlook 2003

    Thanks RobDog888 but perhaps I have not explained well my request:

    when I made a double-click on calendar I had a new appointment item; well, I want to catch the exact moment that this appointment is created

    Thanks in advance

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Handle Events in Outlook 2003

    Ok, then it may be the ItemAdd event but it doesnt fire until you save the item I believe.

    The other option is to write a VB Script event in the appointment form itself. What do you need to do when the form is displayed?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width