OpenFileDialog P_GetFile = new OpenFileDialog(); //创建打开文件对话框对象
DialogResult P_dr = P_GetFile.ShowDialog(); //显示打开文件对话框
object oMissing = System.Reflection.Missing.Value;
if (P_dr == DialogResult.OK) //是否单击确定
{
wordApp = new MSWord.Application();
wordApp.Visible = true;
object obj = (object)(P_GetFile.FileName);
wordApp.Documents.Open(ref obj,ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
}
时间: 2024-11-05 22:35:56