Microsoft Project VSTO C# - Event Listener when ch

2019-09-02 05:09发布

I'm having a little trouble

I'm trying to write a handler for a Project 2013 addin to listen for changes that occur in a cell in MS Project. If the cell is changed, I want to then enter a flag into one of the hidden cells

Any ideas?

1条回答
Viruses.
2楼-- · 2019-09-02 05:45

You'll need to add an event handler like this:

    private void MyEventHandler(Task task, PjField field, object newValue, ref bool cancel)
    {
        // My code here
    }

As part of your Add-In's setup you need to add your event handler:

    Application.ProjectBeforeTaskChange += MyEventHandler;

As tasks are changed, your event handler will be called. You can then check to see which attribute is being changed, and if it is one that's relevant to you, you can make the changes you need to the project.

查看更多
登录 后发表回答