VBA Code


objNamespace.GetDefaultFolder(Outlook.olDefaultFolders.olFolderInbox)
For Each objObject In objFolder.Items





Session


CDO Session
This is the CDO root object
Session.Logon
Session.Logoff
Session.GetMessage




Explorer Object

This is the window where the folders content are displayed


Me.ActiveExplorer.CurrentFolder.Name
Me.ActiveExplorer
Explorer.CurrentView
Explorer.Selection.Count




Inspector Object

This is the window where an Outlook item is displayed

Me.Inspectors 


Namespace Object

The Session property returns a Namespace object that enables you to access the underlying Outlook data store and give you access to the default folders.
You can access the Namespace object by using the Application's Session property


Dim objInbox As Outlook.MAPIFolder 
objInbox = Me.Session.GetDefaultFolder(olDefaultFolders.olFolderInbox)

Dim objNamespace As Outlook.Namespace 
Dim objInbox As Outlook.MAPIFolder
objNamespace = Application.Session
objInbox = Me.Session.GetDefaultFolder(olDefaultFolders.olFolderInbox)



Outlook Folders

FolderItems Folder ContentsEnumeration 
CalendarAppointmentItemolDefaultFolders.olFolderCalendar 
 MeetingItem  
ContactsContactItemolDefaultFolders.olFolderContacts 
 DisListItem  
DeletedItemsAnyolDefaultFolders.olFolderDeletedItems 
DraftsMailItemolDefaultFolders.olFolderDrafts 
InBoxMailItemolDefaultFolders.olFolderInbox 
 DocumentItem  
 TaskRequestItem  
 TaskRequestUpdateItem  
JournalJournalItemolDefaultFolders.olFolderJournal 
Junk E-mailMailItemolDefaultFolders.olFolderJunk 
NotesNoteItemolDefaultFolders.olFolderNotes 
OutboxMailItemolDefaultFolders.olFolderOutbox 
Sent ItemsMailItemolDefaultFolders.olFolderSentMail 
 DocumentItem  
 TaskRequestAcceptItem  
 TaskRequestDeclineItem  
TasksTaskItemolDefaultFolders.olFolderTasks 
Public FoldersPostItem  

Outlook Items - 16

Items are contained in folders
An Items collections can contain multiple types of objects
This collection always returns an Object so you must cast it to the correct Outlook item.



ItemDescriptionEnumeration 
AppointmentItemA meeting or appointment in the Calendar folder  
ContactItemA contact containing information about a person in the Contacts folder  
DisListItemA distribution list containing several contacts in the Contacts folders  
JournalItemA journal entry in the Journal folder  
MailItemAn e-mail message in the Inbox, Outbox or SentItems folder  
MeetingItemAn item in the InBox folder that contains information about a scheduled meeting to be added to the Calendar folder. An AppointmentItem becomes a MeetingItem when received in the InBox.  
NoteItemA note in the Notes folder  
PostItemA post in the public folder or a mail folder  
RemoteItemA remote item in the InBox: similar to a MailItem but contains a subset of the information. Eg Only 256 characters of a message body are available before the message is downloaded.  
ReportItemA report in the InBox: similar to a MailItem but also contains a report. These items are generated automatically when an error occurs.Outlook.ReportItem 
TaskItemA task in the Task folder: the task can be created by the owner or assigned by another personolItemType.olTaskItem 
TaskRequestAcceptItemA response in the InBox that accepts a task requestOutlook.TaskRequestAceptItem 
TaskRequestDeclineItemA response in the InBox that declines a task requestOutlook.TaskRequestDeclineItem 
TaskRequestItemAn object that represents a task that has been assignedOutlook.TaskRequestItem 
TaskRequestUpdateItemAn object tha represents an update of information for a task that has been previously assigned.Outlook.TaskRequestUpdateItem 





© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrev