Stephen,
You need to put in =loTask.Delete

the "=" sign is needed as it returns a status

Dave


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


I have created a set of functions that create tasks from my helpdesk
application and out them into the correct date column, however I can not
get the function to delete a task working here is the code I am using :-

function cleartasks
        loOutlook = CREATE("Outlook.Application")
        loNamespace = loOutlook.GetNameSpace("MAPI")
        oTasks = loNameSpace.GetDefaultFolder(13)
        for each loTask in oTasks.Items
                if substr(loTask.Subject,1,1)='#'
                   loTask.Delete
                endif
        endfor
return

When i run this the line [lotask.Delete] crashes saying "Parameter not
optional", after googling this I found I need some reference number to
pass as a parameter ???

Any assistance would be greatly appreciated.
-- 
  Stephen Weeks
  [email protected]

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service


[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