Wednesday, March 31, 2004

Calling InfoPath Solutions

The XDocument object model offers a variety of methods and properties that are pretty easy to take advantage of when writing an InfoPath form. While contemplating this I received an email from a reader asking – “How can I call into another InfoPath solution from my existing solution?”

While conversing through email I came to find out that he was looking to create a button bar of sorts. His goal was to have a central form that contained buttons that would load other InfoPath forms. This is actually pretty easy to accomplish using the following script.

Application.XDocuments.NewFromSolution("C:\\templates\\mytemplate.xsn");

Note: It is important to remember that you need to place \ between any of your file paths.

Here is a link to a sample that shows how this can be done with a button. Keep in mind that when opening this, you will need to change the path to match what is on your local machine.

 

 


9:56:35 PM    
comment [] trackback []