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.
dianah - 12 Dec 2005 18:10 GMT
I have forms that a user will fill out and submit to SharePoint. There is no
> uniques "title" or other identifying info when submitted. Another user could
> come along and fill out the form with the same information in the title field
[quoted text clipped - 13 lines]
> 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.
Ben walters - 13 Dec 2005 02:05 GMT
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/details.aspx?FamilyId=7E9EBC57-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
> 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.