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: 33818 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Microsoft Office Automation
Date: Thursday, December 04, 2003 12:30:41 AM         
   


hmmm.. Sorry but I don't think so.

OK, let 's start over.

A new mail arrives in the inbox.
Somemore mails are arriving also.

The user scrolls through all headers to see if there is anything of interest to him.
He highlights a mail with one or more attachments, then presses a button on the outlook toolbar, which starts a small vfp app.

This vfp app, will have to find the currently highlighted mail item and save all attachments automatically.

See it like some sort of filing system. You open the mail that contains valuable information, in order to save this information, you need to open the drawer (vfp) and insert the attachments into the bin (=hard disk);..

I would like to archive information related to cases/prospects in an easy way, without the user having to do anything manually.
(it should go as automatically as possible)..

I just hopes this clarifies my problem a bit... I am not sure, however, if I write English fluently enough to make you help understand my problem, I am sorry for that.

Kind regards,

Sven



> This may give you some valid information:
>
> ?oOutLookObject.ActiveWindow.caption
> ?oOutLookObject.ActiveWindow.WindowState
>
> >
> > I need the item that is highlighted.
> >
> > Or.. how can I check for the itemwindow current status ?
> >
> > Do you have code I can try out ?
> >
> > Many thanks,
> >
> >
> >
> > > The problem is that it is not quite clear, what is the "currently selected/active " item in the box: user may open many items and have their windows open (minimized, normal…). The only one is highlighted in the inbox, but it is not necessarily the item that is currently viewed in the separate window in front of the user.
> > >
> > > Possibly you need ..items.Getnext or …items.Getprevious, or need to check for the item window current status.
> > >
> > > > 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