|
-
Aug 23rd, 2000, 01:37 AM
#1
Thread Starter
New Member
Dear all,
Thank to automating Outlook with OLE by Steve Anderson, could anyone tell me if it is possible to automate receiving mail using Outlook? I have studied the codes provided by Steve. However, there is no similar methods for me to get the mail from the inbox instead.
Thank you very much in advance.
Best regards,
Ivan
-
Aug 23rd, 2000, 09:02 AM
#2
Guru
Code:
'read MS Outlook Inbox
'uses Outlook 8/9 Object Model
Sub ReadFolder()
Dim objOL As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.MAPIFolder
Dim objMail As Outlook.MailItem
Dim intItemCount As Integer
'create objects, get mapi
Set objOL = New Outlook.Application
Set objNS = objOL.GetNamespace("MAPI")
'get inbox
Set objFolder = objNS.GetDefaultFolder(olFolderInbox)
'loop thru inbox, display items
For intItemCount = 1 To objFolder.Items.Count
Set objMail = objFolder.Items.Item(intItemCount)
Debug.Print objMail.SenderName & ": " & objMail.Subject
Next intItemCount
'cleanup
Set objFolder = Nothing
Set objMail = Nothing
Set objNS = Nothing
Set objOL = Nothing
End Sub
-
Aug 23rd, 2000, 08:33 PM
#3
Thread Starter
New Member
Any difference between Outlook Express and Outlook?
Dear all,
Thank you very much for your help. However, I have tried using the same code for Outlook Express but it failed. Could anyone help me on it? Thank you very much for your assistance in advance.
Best regards,
Ivan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|