开发者

How to Activate a Word document?

开发者 https://www.devze.com 2023-02-07 16:24 出处:网络
I am creating word document from c# windows application. but Word document is getting minimized even though i used the Activate() method to activate the document.

I am creating word document from c# windows application. but Word document is getting minimized even though i used the Activate() method to activate the document.

(it is working fine when debugging but in release version document getting minimized)

How I Can Make the document active one???

Thanks in advance.

my code is almost like this

Microsoft.Office.Interop.Word.Document document;

object objFileName = locationOfFile; object objTrueValue = true; object objMissing = Type.Mis开发者_如何学Gosing;

document = application.Documents.Open(ref objFileName, ref objMissing, ref objTrueValue, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing, ref objMissing);

document.Activate();


It is working for both.

document = application.Documents.Open(@"\Docu.docx", ReadOnly: false, Visible: true );

set the Visible:true, Document.Activate(); is not required.

It would be help more if you show your code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号