Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Accessing Email Messages - Outlook Automation

RSS
Modified on Sat, Sep 12, 2009, 8:32 PM by Administrator Categorized as Microsoft Office, Visual Basic 6
The following VB6 code demonstrates how to access email messages via Outlook Automation.

Dim app As Outlook.Application
Dim ns As Outlook.Namespace
Dim f As Outlook.Folder
Dim i As Integer
Dim imax As Integer
Dim msg As Outlook.MailItem

Set app = New Outlook.Application
Set ns = app.GetNamespace("MAPI")
Set f = ns.GetDefaultFolder(olFolderInbox)
Set f = f.Folders("Music Plans")
imax = f.Items.Count

For i = 1 To imax
    Set msg = f.Items(i)
Next

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.