Invoking InfoPath from a C# winform application

K

krabun

I'm new to the InfoPath development arena and I'm trying to programmatically
invoke the InfoPath project I've created from a separate winform application
when the user clicks a menu item. I'm able to run the InfoPath project on
it's own but I haven't been able to find a way to launch it from this
separate app. Any help on the matter would be appreciated (if it's even
possible).

Thanks in advance,
Kevin
 
F

FBiots

This answers my open question about hosting InfoPath forms as a control
inside a WinForm application (No.) To my knowledge this leaves only two
choices: either run InfoPath as a separate application (not acceptable in my
case), or "build your own XSD-based form generator". Is there an alternative
(that doesn't require having a web server like for XForms)?
 
S

Sean

It's possible to start InfoPath from within a .Net app (using the Office
interop stuff, just add the InfoPath exe as a reference to your project).

You can then use a Windows API call to get the window handle of the form (by
using the title of the window), and use that to set its parent to a user
control in your project. You can then position the InfoPath window inside
your user control to hide the title bar. We're hosting the user control in a
webform, but it should work just fine in a winform.

Messy, but until MS adds the functionality we need it'll have to do.

Sean


FBiots said:
This answers my open question about hosting InfoPath forms as a control
inside a WinForm application (No.) To my knowledge this leaves only two
choices: either run InfoPath as a separate application (not acceptable in
my
case), or "build your own XSD-based form generator". Is there an
alternative
(that doesn't require having a web server like for XForms)?

Greg Collins said:
If you are talking about hosting it inside of another app, this currently
is not possible. If you just want to launch it "as a separate app" then
you should be able to do that the same way you would do it for any app.

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



I'm new to the InfoPath development arena and I'm trying to
programmatically
invoke the InfoPath project I've created from a separate winform
application
when the user clicks a menu item. I'm able to run the InfoPath project
on
it's own but I haven't been able to find a way to launch it from this
separate app. Any help on the matter would be appreciated (if it's even
possible).

Thanks in advance,
Kevin
 

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