我想通过Interop打开一个Word文档,并且在过程中必须使Word可见。这似乎很简单,因为在Word文档的“open”函数中有一个名为“visible”的参数。但是Word在后台运行。我错过了什么?
static void Main(string[] args)
{
Microsoft.Office.Interop.Word.Application word = null;
word = new Microsoft.Office.Interop.Word.Application();
object inputFile = "c:\\test.docx";
object confirmConversions = false;
object readOnly = true;
object visible = true;
object missing = Type.Missing;
// Open the document...
Microsoft.Office.Interop.Word.Document doc = null;
doc = word.Documents.Open(
ref inputFile, ref confirmConversions, ref readOnly, ref missing,
ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref visible,
ref missing, ref missing, ref missing, ref missing);
doc.Activate();
Console.ReadKey();
}