相关疑难解决方法(0)

从MS-Word ApplicationClass获取PID?

考虑以下代码:

using Microsoft.Office.Interop.Word;

ApplicationClass _application = new ApplicationClass();
Run Code Online (Sandbox Code Playgroud)

我可以从_application启动的Winword.exe进程中获取PID吗?

我需要PID因为文件损坏,我只是不能退出ApplicationClass,即使使用这段代码:

_application.Quit(ref saveFile, ref missing, ref missing);
System.Runtime.InteropServices.Marshal.ReleaseComObject(_application);
GC.Collect();
GC.WaitForPendingFinalizers();
Run Code Online (Sandbox Code Playgroud)

我无法搜索winword.exe进程并将其杀死,因为我会有几个,而且我不知道要杀哪个.如果我可以为每个ApplicationClass获取一个PID,我可能会杀死正确的winword.exe进程,这会给我带来麻烦.

c# pid ms-word

14
推荐指数
2
解决办法
2万
查看次数

如何在VBA中显示带有Unicode字符的消息框?

我在VBA中有一个包含Unicode字符的字符串。

我想在包含该字符串的消息框中显示该字符串。

但是,消息框仅包含一个问号,而不是字符串。

MCVE:

Dim s As String
s = ChrW(5123)
MsgBox s
Run Code Online (Sandbox Code Playgroud)

ms-access vba access-vba

6
推荐指数
1
解决办法
598
查看次数

标签 统计

access-vba ×1

c# ×1

ms-access ×1

ms-word ×1

pid ×1

vba ×1