1 object m_Word = Type.GetTypeFromProgID("Word.Application", false);2 m_Word = Activator.CreateInstance(m_WordType);3 Type m_WordType = m_WordType.GetProperty("Visible").SetValue(m_Word, true, null);4 object documents = m_WordType.GetProperty("Documents").GetValue(m_Word, null);5 object document = documents.GetType().InvokeMember("Open", BindingFlags.InvokeMethod, null, documents, new object[] { "c:/test.doc" });6 document.GetType().InvokeMember("SaveAs", BindingFlags.InvokeMethod, null, document, new object[] { "c:/new.doc", 8 });7 document.GetType().InvokeMember("Close", BindingFlags.InvokeMethod, null, document, new object[] { });8 m_WordType.InvokeMember("Quit", BindingFlags.InvokeMethod, null, m_Word, new object[] { });
上述代码中,比如document.GetType().InvokeMember方法,第一个参数是“SaveAs”,“Close”,“Quit”,这些参数值,从哪里可以查看其所有可选的值吗?
1 回答
- 1 回答
- 0 关注
- 512 浏览
添加回答
举报
0/150
提交
取消