Tuesday, December 04, 2007

Infopath cannot add the event handler

While working in Infopath 2007 managed code when i tried to attach managed code to existing
form i got the following error:

Error :

Infopath cannot add the event handler

Infopath cannot create the visual basic or C# project

The location for the visual basic or C# project cannot be found or cannot be accessed


So next steps is to search internet , well no luck in that too . Then i decided to try different things with my form settings and shazam!!! got the form working .

Solution in my case :
  • Go to Tools -> Options ->Design Tab
  • Check the language for programming /select the desired language
  • Go to Tools -> Form Options -> Programming Section
  • Select the programming language which you selected in previous settings

That should be good enough to make you go forward.

In my case there was difference in language settings which caused all these errors, which might be in your case too.

Happy Infopath Programming!!!!