Steve,
Me being stupid here. The tasks collection is dynamic so when you delete an 
entry then the collection changes so you can't traverse simply oonce through it 
like you are doing.

Each time you delete a task you have to re-initialise the collection and 
traverse again through it, for example:

loOutlook = CREATE("Outlook.Application")
loNamespace = loOutlook.GetNameSpace("MAPI")
oTasks = loNameSpace.GetDefaultFolder(13)

nDeletions = 99
*
do while nDeletions<>0
        nDeletions=0
        for each loTask in oTasks.Items
                if substr(loTask.Subject,1,1)='#'
                lStatus=loTask.Delete      
                nDeletions = nDeletions + 1 
                exit
                endif
        endfor
enddo
        

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
Dave Crozier
Sent: 23 September 2011 13:53
To: ProFox Email List
Subject: RE: Automating outlook tasks

Steve,
In that case check the return value from the function.

Sometimes Outlook "Suspends" in order to process events and I think this must 
be what is happening and in your case you are simply ignoring the "busy" 
status. This is usually prevalent when the .pst files are either large or held 
on a network storage medium.

Dave


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
Stephen Weeks
Sent: 23 September 2011 13:46
To: [email protected]
Subject: RE: Automating outlook tasks

Thanks for that Dave,

I put the = sign in and it ran, although it did not delete all the tasks
I requested, which are those begining with '#'  cant figure this out
yet.

Regards
Steve

On Friday, September 23, 2011 10:05 AM, "Dave Crozier"
<[email protected]> wrote:
> Stephen,
> You need to put in =loTask.Delete
> 
> the "=" sign is needed as it returns a status
> 
> Dave
> 
> 
-- 
  Stephen Weeks
  [email protected]

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to