MS Project VBA - 如何查找当前活动的任务过滤器?

MS Project VBA - How To Find Currently Active Task Filter?

我想创建一个切换开关以切换过滤器(使用 FilterApply 名称:="fName")并再次返回,但我似乎无法找到一种方法来检查当前应用的过滤器。

有谁知道用 MS API 查询当前活动过滤器的方法吗?

谢谢

人族

    Sub _Unbaselined_Tasks_View()

  ---> Problem Line If ActiveProject.TaskFilter = "Active Tasks With No Baseline" Then
            FilterApply Name:="All Tasks"
            FilterClear
    Else
        FilterApply Name:="Active Tasks With No Baseline"
    End If

End Sub

project object has a property called CurrentFilter 将 return 应用过滤器的名称或 "All Tasks" 如果未应用过滤器。

Sub Elite_Unbaselined_Tasks_View()

    If ActiveProject.CurrentFilter = "Active Tasks With No Baseline" Then
        FilterApply Name:="All Tasks"
        FilterClear
    Else
        FilterApply Name:="Active Tasks With No Baseline"
    End If

End Sub