如何隐藏Word文档?(C#) [英] how to hide a Word Document?(c#)

查看:167
本文介绍了如何隐藏Word文档?(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一些代码来使用C#处理Word文档.

Application app=new Application();
app.Visible = false;
Document doc;
object missing=System.Reflection.Missing.Value;
doc=app.Documents.Open(ref fileName, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
......


当此软件处理Word文档"a.doc"时,打开其他文档"b.doc",将弹出"a.doc".我设置了"app.Visible = false;" .
为什么再次显示.

现在,当该软件处理Word文档时,无法打开其他Word文档.一些代码,但是您稍后可能会创建一个新的Application 实例吗?也许您没有在该实例上设置Visible 属性.


hi, I write a some code to process a Word Document using C#.

Application app=new Application();
app.Visible = false;
Document doc;
object missing=System.Reflection.Missing.Value;
doc=app.Documents.Open(ref fileName, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
......


when this software process a Word Document "a.doc",Open other Document "b.doc", the "a.doc" is popup. I had set "app.Visible = false;" .
why it display again.

now when this software process a Word Document,can''t open other Word Document.

解决方案

It''s impossible to tell what''s going on without seeing some of your code, but are you perhaps creating a new Application instance later on? And perhaps you are not setting the Visible property on that instance.


这篇关于如何隐藏Word文档?(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆