Creating an add-in with Visual Studio .Net 2008 - InfoPath Dev
in

InfoPath Dev

Creating an add-in with Visual Studio .Net 2008

Last post 12-31-2009 04:34 AM by Karsten Brocksieper. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 12-31-2009 04:34 AM

    Creating an add-in with Visual Studio .Net 2008

    Hello,

    I would like to create an add-in based on the project template "Infopath 2007 add-in" in Visual Studio .Net 2008. Now I want to hook up event handlers for the events: XDocumentOpen, NewXDocument and XDocumentBeforeClose.

    I have tried the following in the "ThisAddIn_Startup"-Procedure but without success.

    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
    InfoPath.
    ApplicationClass _applicationObject = (InfoPath.ApplicationClass)this.Application;
    InfoPath.
    ApplicationEvents _applicationEvents = (InfoPath.ApplicationEvents)_applicationObject.Events;

    _applicationEvents.XDocumentOpen += new InfoPath._ApplicationEvents_XDocumentOpenEventHandler(_ApplicationEvents_XDocumentOpen);
    _applicationEvents.NewXDocument +=
    new InfoPath._ApplicationEvents_NewXDocumentEventHandler(_ApplicationEvents_NewXDocumentEventHandler(_applicationEvents_NewXDocument);
    _applicationEvents.XDocumentBeforeClose +=
    new InfoPath._ApplicationEvents_XDocumentBeforeCloseEventHandler(_applicationEvents_XDocumentBeforeClose);
    }

    private void _applicationEvents_XDocumentOpen(_XDocument pDocument)
    {...
    }

    private void _applicationEvents_NewXDocument(_XDocument pDocument)
    {...
    }

    private void _applicationEvents_XDocumentBeforeClose(_XDocument pDocument, ref bool pfCancel)
    {...
    }

    Can anyone help me to get the right syntax for hook up these event handlers.

    Thank you very much.

    Karsten
    Filed under:
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.