0

I'm developing an outlook addin that has a button in a custom task pane (that's in an inspector window). When its clicked, I'd like it to do something to the current active item (in my case, it's the appointmentItem). I've tried this (this code is in the custom task pane class):

    private void button1_Click(object sender, EventArgs e)
    {

        Outlook.Inspector inspector = (Outlook.Inspector)Globals.ThisAddIn.Application.ActiveInspector;
        Outlook.AppointmentItem appt = (Outlook.AppointmentItem)inspector.CurrentItem;
        appt.Body += "this is a test";
    }

but it through me this error:

Cannot convert method group 'ActiveInspector' to non-delegate type 'Microsoft.Office.Interop.Outlook.Inspector'. Did you intend to invoke the method?

Thanks

1 Answer 1

1

I think ActiveInspector is a method & not a property.

Try this
Outlook.Inspector inspector = (Outlook.Inspector)Globals.ThisAddIn.Application.ActiveInspector**()**;

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.