如何在没有错误的情况下多次打开MS WORD [英] How to open several times MS WORD without getting errors

查看:70
本文介绍了如何在没有错误的情况下多次打开MS WORD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我需要打开MS WORD的几个窗口,但我只能打一次。这是打开Word的代码:

Hello, I need to open several windows of MS WORD but I can only do it once . here is the code to open Word:

Process proc = new Process();
           try
           {

               wdwIntPtr = FindWindow(null, processName);
               proc.EnableRaisingEvents = true;
               proc.StartInfo.UseShellExecute = false;

               proc.StartInfo.FileName = processName;
               proc.StartInfo.CreateNoWindow = true;

               proc.Start();
}



当我打电话给我时,我把它放到processName @\ Program Files \ Micro Office Office \ Office15 \ WINWORD.EXE

我得到的错误是:请求的信息不可用,因为没有执行该过程



我尝试过:



i无法打开Office产品,但记事本,计算器工作。我可以打开几次


When I call it I put to processName @"\Program Files\Microsoft Office\Office15\WINWORD.EXE"
The error that I got is : "the requested information are not available because the process is not executed"

What I have tried:

i can't open Office product but notepad , calculator work. I can open several times

推荐答案

你无法打开WinWord几次。获取MS Word的实例并使用打开该实例来记录它。



这是一个想法:如何使用Visual C#自动运行正在运行的Office程序实例 [ ^ ]

c# - 如何使用后期绑定访问Microsoft Word现有实例 - Stack Overflow [ ^ ]

http://www.codeproject.com/问题/ 186322 / MS-word-using-C的运行方式如何使用 [ ^ ]
You can't open WinWord several time. Get the instance of MS Word and use open that instance to document in it.

Here is an idea: How to use Visual C# to automate a running instance of an Office program[^]
c# - How to access Microsoft Word existing instance using late binding - Stack Overflow[^]
http://www.codeproject.com/Questions/186322/How-to-get-running-insatnce-of-MS-word-using-C[^]


这篇关于如何在没有错误的情况下多次打开MS WORD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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