-1

我需要打开一个word文件进行写作。这是我的代码:

private void button1_Click(object sender, `EventArgs` e)
{
    var wordApp = new Microsoft.Office.Interop.Word.Application();

    object useDefaultValue = Type.Missing;
    object readnly = false;
    object visibe = true;
    wordApp.Documents.Open("f:\\test2.docx");
}

但它以只读方式打开我的文件。为什么?

4

1 回答 1

0

为我工作

Word._Application oWord;
Word._Document oDoc;
object oMissing = Type.Missing;
oWord = new Word.Application();
oWord.Visible = true;

//Add Blank sheet to Word App
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); 

oWord.Selection.TypeText("Write your text here");
于 2013-04-17T11:27:23.413 回答