def rule(event):
    if all(
        [
            "\\SOFTWARE\\Microsoft\\Office\\" in event.deep_get("TargetObject", default=""),
            "\\Outlook\\" in event.deep_get("TargetObject", default=""),
            any(
                [
                    "\\Tasks\\" in event.deep_get("TargetObject", default=""),
                    "\\Notes\\" in event.deep_get("TargetObject", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
