Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Erik Gomez
  Where is Erik Gomez?
 Victorias City, Negros Occidental
 Philippines
 Erik Gomez
 To: Rob Laye
  Where is Rob Laye?
 Hinckley
 United Kingdom
 Rob Laye
 Tags
Subject: RE: Read Messages with MAPI
Thread ID: 4703 Message ID: 15857 # Views: 2 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Wednesday, October 02, 2002 2:00:09 PM         
   


> > Sample of what I use to get email attachements form the mailbox
> >
> > myOlApp = CREATEOBJECT("Outlook.Application")
> > myNameSpace = myOlApp.GetNameSpace("MAPI") &&Gets current MAPI Session
> > myNameSpace.LogOn("FC","") &&In this case,FC is the Windows Login Name, Password=blank
> > myFolder = myNameSpace.GetDefaultFolder(6) &&Gets the Inbox
> > FOR i = 1 TO myFolder.Items.Count &&Loops through all the inbox messages
> > myItem = myFolder.Items(i)
> > IF myItem.Subject = "You can use this if there is a particular subject you expect"
> > IF myItem.Unread() AND myItem.Attachments.Count > 0 &&Unreadw/Attachment
> > myItem.Attachments.Item(1).SaveAsFile("K:\"+myItem.Attachments.Item(1).FileName)
> > ENDIF
> > ENDFOR
> >
> > > Hello, Andy
>
> I found your code and it does almost what I need is there anyway to pass back to outlook
> thatthe message has been read or just delete it
>
> Regards
> Rob
>
>
>
>
hi Rob,

from the code above you can just add the line:

myItem.Delete

before the EndFor command.

hth,
Erik Gomez
Long Live www.foxite.com

ENTIRE THREAD

Read Messages with MAPI Posted by Sandu Sorin @ 10/30/2001 2:59:36 PM
RE: Read Messages with MAPI Posted by Andy van Steijn @ 10/30/2001 4:00:57 PM
RE: Read Messages with MAPI Posted by Rob Laye @ 10/2/2002 12:07:32 PM
RE: Read Messages with MAPI Posted by Erik Gomez @ 10/2/2002 2:00:09 PM
RE: Read Messages with MAPI Posted by aktayal @ 10/5/2002 3:46:28 PM