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
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