RNG

D

dianah

I have found a C# script on the Code Project site, however, I am not a
developer and need to use the script in an InfoPath form. How does one
accomplish this? With a few instructions I can probably do this, I just need
to know what tools are needed and how to add it to InfoPath (in field
properties) to make it work when the button is clicked.
 
B

Ben walters

Dianah

Using C# code behind an InfoPath form can be done but be aware that it is
not for the faint of heart, I have included some instructions on what you
will need to do to get you started however I suggest you look into at lest
some basic info on programming with C#.

To use this C# script you will need a couple pieces of software,
1: Visual Stuido 2003
2: The InfoPath toolkit for Visual Studio you should be able to get the kit
from here
http://www.microsoft.com/downloads/...57-E115-4CAC-9986-A712E22879BB&displaylang=en


Once you have the above installed,
- open Visual studio and select New Project
- in the New Project dialog you will see a folder titled "Microsoft Office
InfoPath Projects" below this there are 2 more folders one for VB projects
and one for C# projects
- Select the C# project and give the project a name then click ok (You will
then be presented with the Microsoft Office Project Wizard)
- Select the "Open Existing Form Template" option and browse to your
previously designed form ( this will create a copy of your original form that
has managed code behind it rather than script)
- Click finish to complete the wizard (InfoPath will open with your form in
it)
- Add a button to your form and click to open the properties
- Click the Edit Form code button (Visual studio will be displayed with an
event for the button)
- add the code to the newly created even then press F5 to run your project
and test.

I hope this helps
Cheers
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top