"MAPI & Fetch method question" 
Author Message
 "MAPI & Fetch method question"

I now have my VB app downloading my email from my inbox folder, but was
wondering if it at all possible to fetch only those messages that have a
particular subject heading.  My code is below if you have the time to take a
look at where I could do this. I thought that the fetch method would have
some optional parameters, but I guess I was wrong.

Thanks Joe :)

Private Sub Form_Load()

Dim myOlApp As Object
Dim olNameSpace As Object
Dim oFolder As Object
Dim mySession As Object

'assign new OUTLOOK object to a variable for holding
Set myOlApp = CreateObject("Outlook.Application")

Set olNameSpace = myOlApp.GetNamespace("MAPI")
'make sure we are working with INBOX
Set oFolder = _
olNameSpace.GetDefaultFolder(olFolderInbox)

'initiate a connection to messaging system
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
'grab the count of attachments
attachCount = MAPIMessages1.AttachmentCount

'fetch messages from inbox and display message to user indicating the number
of new messages
MAPIMessages1.Fetch

sbStatusBar.Panels(1).Text = "There are " & MAPIMessages1.MsgCount & " new
Vacation Package requests in your inbox"

Set myOlApp = CreateObject("Outlook.Application")
Set olNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = _
olNameSpace.GetDefaultFolder(olFolderInbox)
'will bring up inbox folder
'myFolder.Display

End Sub



Sat, 30 Aug 2003 03:37:51 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Recordset "fetch" evernts

2. "Fetch type out of range" error

3. Question with the "CopyFolder" method

4. Problem: "Invalid Message" when using .FETCH method with MAPI, VB6 and OE 5.0

5. Problem: "Invalid Message" when using .FETCH method with MAPI, VB6 and OE 5.0

6. Problem with MAPI control method FETCH in win 95

7. Problem with MAPI control method FETCH

8. Using MAPI Fetch method with Outlook Express

9. Problems with MAPI: fetch method

10. CreateObject("Access.application.8")

11. "text" property read-only

12. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

 

 
Powered by phpBB® Forum Software