Use InactivateTaskToggle method to inactivate tasks

Joined
Jun 23, 2015
Messages
1
Reaction score
0
Hi All

I am trying to write a macro that will inactivate certain task based on a criteria.
I saw that there is a method to inactivate the task using InactivateTaskToggle()
https://msdn.microsoft.com/en-us/library/office/ff866141.aspx
This is the code I am using. However, even though I am inactivating only those task that fit the condition, the result is that all tasks are inactivated. What am I doing wrong?

SelectAll
Set ts = ActiveSelection.Tasks
For Lrow = LastTSkID To FirstTkID Step -1
Set t = ts(Lrow)
If Not t Is Nothing Then
If InStr(UCase(t.Text4), UCase(strType)) = 0 Then
t.Application.InactivateTaskToggle (False)
End If
End If
Next Lrow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top