Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: sfx dunoo
  
 
 
 sfx dunoo
 To: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 Tags
Subject: RE: outlook automation and mailitem.current
Thread ID: 33687 Message ID: 33751 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Microsoft Office Automation
Date: Wednesday, December 03, 2003 12:36:14 AM         
   


Hello Yuri,

It should be the message that is currently selected/active in the inbox.

I know what you mean to say, but this approach is not really what I am looking for..
Imagine the mails are flowing in and you don't knowthe subject...

I think it should be possible to save the attachments of the currently selected mailitem to a folder from within vfp.

I know how to save all attachments that are in ALL messages in the inbox.. I have this code.

Now I would like to find out how I can save the attachments from ONE mail only (without having to know or remember the subject of that one message)..

Please, do you have a solution ? I need this rather quickly...

Many thanks for your help,




> Not quite clear, what is the problem with "ONE or MORE selected message only". Why not just use something like:
> if loItem.Subject="bla...blah..."
> * do what you need with attachment......
> endif
>
>
> > Hello,
> >
> > I have found this sample program with which it is possible to save all attachments that are contained within all messages.
> > I have been searching for a program with which it would be possible to save the attachments from ONE or MORE selected message only, but NOT ALL.
> >
> > Can anyone help me ?
> >
> > many thanks in advance,
> >
> >
> > Sven
> >
> > #DEFINE olFolderInbox 6
> > Local lcFilename,lcPath
> > lcPath="c:\savedattachments\"
> > If  !Directory("c:\savedAttachments")
> >     Md "c:\savedAttachments" && Create the directory if it doesn't exist.
> > Endif
> > oOutLookObject = Createobject("Outlook.Application")
> > olNameSpace = oOutLookObject.GetNameSpace("MAPI")
> > 
> > &&myAtts = olnamespace.getdefaultfolder(olfolderinbox).item
> > &&myAtts=olNameSpace.GetDefaultFolder(olFolderInbox).items()
> > 
> > &&(OlApp.ActiveInspector().CurrentItem as MailItem).Subject 
> > 
> > messagebox("aantal mails = " + str(olNameSpace.GetDefaultFolder(olFolderInbox).items.count))
> > 
> > &&myAtts=olNameSpace.GetDefaultFolder(olFolderInbox).items()
> > 
> > locurrwindow= ooutlookobject.activeexplorer
> > messagebox(loCurrWindow.CurrentFolder.Name)
> > locurrwindow.activeExplorer.CurrentFolder = olNameSpace.GetDefaultFolder(olFolderInbox)
> > 
> > For Each loItem In myAtts
> >     If loItem.attachments.Count >0 && Make sure there is an actual attachment.
> >         For i = 1 To loItem.attachments.Count
> >             lcFilename=""
> >             lcFilename = loItem.attachments.Item(i).filename
> >             lcFilename = Alltrim(lcPath)+lcFilename
> >             loItem.attachments.Item(i).SaveAsFile(lcFilename)
> >            *loItem.Delete() && The option to delete the message once the attachment has been saved.
> >         Next
> >     Endif
> > Next
> > 



ENTIRE THREAD

outlook automation and mailitem.current Posted by sfx dunoo @ 12/1/2003 10:48:25 PM
RE: outlook automation and mailitem.current Posted by Yuri Rubinov @ 12/2/2003 2:51:23 PM
RE: outlook automation and mailitem.current Posted by sfx dunoo @ 12/3/2003 12:36:14 AM
RE: outlook automation and mailitem.current Posted by Yuri Rubinov @ 12/3/2003 2:56:54 PM
RE: outlook automation and mailitem.current Posted by sfx dunoo @ 12/3/2003 5:38:50 PM
RE: outlook automation and mailitem.current Posted by Yuri Rubinov @ 12/3/2003 9:25:15 PM
RE: outlook automation and mailitem.current Posted by sfx dunoo @ 12/4/2003 12:30:41 AM
RE: outlook automation and mailitem.current Posted by Yuri Rubinov @ 12/4/2003 3:22:11 PM
RE: outlook automation and mailitem.current Posted by sfx dunoo @ 12/5/2003 12:36:46 AM