Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-16-2014, 11:42 AM
niton niton is offline Peculiar Outlook VBA item, Application_Quit Windows 7 64bit Peculiar Outlook VBA item, Application_Quit Office 2010 64bit
Competent Performer
 
Join Date: Jul 2012
Posts: 102
niton is on a distinguished road
Default

Object required. Here is sample code.

Code:
 
Private Sub Application_Quit()
    Dim olItems As Outlook.Items, olItem As Object, i As Integer
 
    Dim olInbox As Outlook.MAPIFolder
 
    Set olInbox = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
 
    Set olItems = olInbox.Items  ' <----
 
    For Each olItem In olItems
        i = i + 1
    Next
 
    Debug.Print " Number of items in Inbox: " & i
    MsgBox " Number of items in Inbox: " & i
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 'actions' menu item moved to the left? galgewater Outlook 0 07-30-2012 07:05 AM
How do I delete an Outlook appointment item with VBA? Joe Patrick Outlook 0 07-14-2011 06:56 AM
How to Delete Outlook Item with VBA Joe Patrick Outlook 0 07-14-2011 06:49 AM
How do you update existing Outlook calendar item from Word with macro? Joe Patrick Word VBA 0 07-09-2011 05:32 AM
Peculiar Outlook VBA item, Application_Quit Peculiar cell behavior markg2 Excel 7 05-28-2011 07:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft