0

I have a 2007 InfoPath form that I'm hosting on my SharePoint (not web-enabled) to which I'd like to add some C# code to make it more robust.

I am well aware that InfoPath 2007 is programmable with a variety of managed and unmanaged languages. My desire is to use C# through VSTA (Visual Studio Tools for Applications) to add some spiffy, new features to my InfoPath form. Everything that I've looked at has mentioned going to:

Tools -> Form Options -> Programming -> Form Template Code Language

and changing the selection to C#. I would be happy to do this, except that there IS no Form Template Code Language section. I've seen the screenshots of the window in tutorials and videos. Under the Programming category on the left, there are TWO section: Custom Task Pane (which I have) and Form Template Code Language section, which is nowhere to be found on mine.

On top of this, any place where I should be able to click "Edit Form Code" (such as in a button's properties window) to automatically launch VSTA and edit the event code, the button is also missing.

I have installed VSTA through the Programs and Features interface, and as far as I can tell, I have MSXML 6.0 installed (the .dll for it exists in my System32 folder) which are both requirements of this process according to the MSDN tutorial here.

I've tried repairing my Office 2007 install, and I've tried removing InfoPath altogether and reinstalling just that piece, but nothing has worked. Would someone please help me before I pull the rest of my hair out?

Thank you.

1

If you have the privileges to do so, make a change in the system registry.

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\12.0\InfoPath\Designer\RestrictedFeatures]
"CodeAllowed"=dword:00000001

Restart InfoPath and the Programming option should be available from the Tools menu.

| improve this answer | |
  • This did the trick! Fantastic! Thanks. I was unable to edit the value as my current user, so I had to go in as admin and go through USERS instead of CURRENT_USER, but it's here now! – Taylor Lopez May 21 '15 at 20:52
  • How did you even discover this solution? – Taylor Lopez May 21 '15 at 20:57
  • Sorry, one of the security organizations upstream was blocking something that borked the CSS styling on the entire site, so I couldn't really get back in and answer your last question. Honestly, I don't really remember where I found the solution, only that Google led me to it several years ago when we ran into the same problem. I actually put it into a .reg file so that I could run it whenever group policy reset the value. – NateV May 28 '15 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.