How to get object for selected task?

  • Thread starter Thread starter Ric
  • Start date Start date
R

Ric

Hi,

I'm trying to write a macro that changes a few properties of a taskitem. I
figured out how to do this when the taskitem is opened in the
activeinspector. However, I'd like the macro to also work when the task is
selected from the list of tasks (or when the text cursor is inside any of
the fields in a task in the list view). However, I haven't been able to find
out how to get the object associated with the selected task. Can someone
point me in the right direction?

Thanks!
 
Set myTask = Application.ActiveExplorer.Selection.Item(1) 'The first item if more than one task item is selected
myTask.Start = Now() 'Example how to set a property

John
 
ActiveExplorer.Selection(1)

Note that this works in the Tasks folder, but you won't get any Selection
object from the TaskPad in the Calendar folder.
 
On a similar note... Is there a way to get the currently selected item from an Advanced Find dialog box?

John
 
No difference at all.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



John Riddle said:
Sue,

Thanks. Shows my short-sightedness while envisioning uses. Is there any
difference to using ActiveExplorer.Selection(1) vs.
ActiveExplorer.Selection.Item(1)?
 
Actually, it's the selection in the taskpad in the Calendar folder I'm
interested in. Is there any way to address that?

Thanks,
Ric
 
No.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top