| |
adminkoe
Posts: 117
Score: 0
Joined: 12/23/2000
From:
Status: offline
|
'This code should show you how to access Outlook 2000 and retrieve some data. Use defaultfolder #6 and go to the message body to retrieve the line. Do you know how to open an Excel app via vbscript? Set appOutl = Wscript.CreateObject("Outlook.Application") Set objSession = appOutl.GetNameSpace("MAPI") objSession.Logon Profile_Name_Here ' 3 = "Deleted Items" ' 4 = "Outbox" ' 5 = "Sent Items" ' 6 = "Inbox" ' 9 = "Calendar" ' 10 = "Contacts" ' 11 = "Journal" ' 12 = "Notes" ' 13 = "Tasks" ' 15 = "Reminders" ' 16 = "Drafts" ' *** INBOX folder Set MyFolder = objSession.GetDefaultFolder(6) Msgbox MyFolder.name & ", " & MyFolder.Items.Count ' Set MyItem to the collection of items in the folder. Set myItems = myFolder.Items ' Loop through all of the items in the folder. For I = 1 to MyFolder.Items.Count MsgBox MyItems(I).subject MsgBox MyItems(I).body Next ' *** Contacts Folder Set MyFolder = objSession.GetDefaultFolder(10) Msgbox MyFolder.name & ", " & MyFolder.Items.Count Set myItems = myFolder.Items.Restrict("[MessageClass] = 'IPM.Contact'") For I = 1 to MyFolder.Items.Count MsgBox MyItems(I).FullName Next
|
|