none
Clear Flag on all sent tiems by scipt RRS feed

  • Question

  • Hi to all!

    I wanna clear flag (and categories) on all itemes inside "Sent items" folder, automatically by script. I found this macro but not working on my Outlook 2010:

    https://social.msdn.microsoft.com/Forums/office/en-US/f798efd3-900d-4f5c-8dea-aa7a254a6898/vb-clear-flagreminder-this-doesnt-work-completely-for-o2003-?forum=outlookdev

    Also, is possible run a macro automatically?

    My goal is cleanup sent items because those flagged will not archived

    Thanks!

    Wednesday, December 23, 2015 12:33 PM

Answers

  • Hello,

    > I found this macro but not working on my Outlook 2010:

    What code exactly do you have now? Most probably you need to use the global Application property for instantiating an instance of the Application class.

    Anyway, you can handle the ItemAdd event which is fired when one or more items are added to the specified collection. So, the VBA sub will be called when a new item(s) is added to the folder.

    Public WithEvents myOlItems As Outlook.Items 
     
    Public Sub Initialize_handler()  
     Set myOlItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items  
    End Sub 
     
    Private Sub myOlItems_ItemAdd(ByVal Item As Object)  
     ' process the added item there - see the Item object passed 
    End Sub

    Finally, the Getting Started with VBA in Outlook 2010 article is a good start for newbies.


    Wednesday, December 23, 2015 1:09 PM