求教Document.Activate这句话是什么意思???
这是我上一个帖子,里面说word打印时,就一直停在那里
其中源代码里面有一句doc.Activate();当我注掉这句话之后word打印恢复正常了。。。o(╯□╰)o
public void PrintWord(string path) { Object nothing = Missing.Value; Object falseValue = false; Object trueValue = true; Object pages = 1; Object paths = path; MSWord.ApplicationClass app = new Microsoft.Office.Interop.Word.ApplicationClass(); app.Visible = false; MSWord.Document doc = app.Documents.Open(ref paths, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref trueValue, ref nothing, ref nothing, ref nothing, ref nothing); // doc.Activate();<-------------------------------------这里 doc.PrintOut(ref trueValue, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref pages, ref nothing, ref nothing, ref falseValue, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing); doc.Close(ref falseValue, ref nothing, ref nothing); app.Quit(ref nothing, ref nothing, ref nothing); GC.Collect(); }