简体   繁体   English

如何在C#中以编程方式打开Microsoft Infopath?

[英]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. 我需要提供等效的超链接才能在UI中打开新的信息路径表单。 However, that is all that the button should do - open the correct form by filepath, in InfoPath, and then the reference should be dropped. 但是,这就是按钮应该做的所有事情-在InfoPath中按文件路径打开正确的表单,然后删除引用。

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. 这是我用来解决问题的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM