How to programmatically open Microsoft Infopath in C#?
I need to provide the equivalent of a hyperlink to open a new infopath form within my UI. However, that is all that the button should do - open the correct form by filepath, in InfoPath, and then the ref开发者_运维百科erence should be dropped.
Does anyone know how to do this?
Thanks!!
badPanda
void mDisplayForm_Click(object sender, EventArgs e)
{
int count = 0;
foreach (ToolStripMenuItem template in mDisplayForms)
{
if (sender.ToString() == template.Text)
{
Process infoPath = new Process();
infoPath.StartInfo.FileName = "InfoPath.exe";
infoPath.StartInfo.Arguments = templates[count];
infoPath.Start();
count++;
}
}
}
This is the code I used to solve the problem.
精彩评论