Graeme
Graeme

Reputation:

Launch Infopath form with parameter

Opening an Infopath form with parameter can be done like this:

System.Diagnostics.Process.Start(PathToInfopath + "infopath.exe", "Template.xsn /InputParameters Id=123");

But that requires I know the path to Infopath.exe which changes with each version of Office. Is there a way to simply launch the template and pass a parameter? Or is there a standard way to find where Infopath.exe resides?

Upvotes: 0

Views: 1355

Answers (3)

Jason Watts
Jason Watts

Reputation: 1038

Try using browser based form and querystring instead

Upvotes: 0

bryansh
bryansh

Reputation: 303

Here's an article about finding the install path for Office Apps:

http://support.microsoft.com/kb/234788

Upvotes: 1

Steve
Steve

Reputation: 2345

Play around with System.Diagnostics.ProcessStartInfo which allows you to specify a file you wish to open and also allows you to specify arguments.

You can then use Process.Start(ProcessStartInfo) to kick off the process. The framework will determine which application to run based on the file specified in the ProcessStartInfo.

I don't have Infopath installed so I unfortunately can't try it out. But hopefully it helps you out a little.

Upvotes: 1

Related Questions