I got this error while trying to write code in InfoPath 2010
. The full error message is "InfoPath cannot add the event handler. Adding Visual Basic or C#.Net code to a form requires Microsoft Visual Studio Tools for Applications (VSTA). To enable this features, run Microsoft Office 2010 setup, and change the Microsoft Visual Studio Tools for Applications options under InfoPath to Run from My Computer. The Microsoft .Net framework 2.0 must be installed before installing VSTA."
Also you can check out my previous posts on:
Follow below steps to do this:
Go to Start -> Control Pannel -> Programs and then click on Uninstall a program. Then select the Office verison you have installed and select Change as shown in the figure below:
Then Select Add or Remoce Features as shown in the figure below and Click Continue.
Then in the Installation Options Expand Microsoft InfoPath and Select Visual Studio Tools for Applications and click Run from My Computer as shown in the figure below and click on Continue.
Once the installation over. Restart the infopath and you can able to write code in the InfoPath form.