gpt4 book ai didi

c# - 使用 C# 启动 Outlook

转载 作者:太空狗 更新时间:2023-10-29 22:13:19 25 4
gpt4 key购买 nike

我可以在代码中让 C# 启动 Outlook 吗?

在 VB6 中我们使用对象 'Outlook.Application' 并写:'

Set oOutlook = CreateObject("Outlook.Application") 
Set oNameSpace = oOutlook.GetNamespace("MAPI")
Set oInbox = oNameSpace.Folders(1)
'Set oInbox = oInbox.Folders("Inbox")
oInbox.Display
'oOutlook.Quit 'Close All Outlook copies

从链接复制/粘贴:http://www.ozgrid.com/forum/showthread.php?t=73886

最佳答案

System.Diagnostics.Process 只会启动一个进程。

要执行其他操作(例如选择文件夹),您需要使用 Microsoft Visual Studio Tools for Office (VSTO)。和 here是它的引用。例如:

var outlook = new Microsoft.Office.Interop.Outlook.ApplicationClass();
outlook.Quit();

关于c# - 使用 C# 启动 Outlook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/824311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com