Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / July 2004

Tip: Looking for answers? Try searching our database.

Code behind infopath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tina - 15 Jul 2004 21:23 GMT
I want to enter a file name and path in a textbox.  I want to infopath
to check a radiobutton based on whether the file exists or not.
 
Is this possible in Infopath?

i would like to use c# for the code module.
David Fries [MSFT] - 16 Jul 2004 12:58 GMT
Interesting request, but I believe it is possible.
InfoPath has a data based programming model, so you should think of things
as nodes in your xml, rather than controls on the form, at least when it
comes to programming.

Here's how to get the value of a textbox in C#.
string filename = thisXDocument.DOM.selectSingleNode("//my:field1").text;
You can then use .NET Framework classes (Probably System.IO) to see if the
file exists or not.

Once you know whether the file exists or not, you can set the value of the
node that the radio button is bound to like so:
thisXDocument.DOM.selectSingleNode("//my:field2").text = "false";

Thanks,
Dave

Signature

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm
--

> I want to enter a file name and path in a textbox.  I want to infopath
> to check a radiobutton based on whether the file exists or not.
>
> Is this possible in Infopath?
>
> i would like to use c# for the code module.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.