使用协议“mapi://”从 C# 打开 Outlook 中的邮件
我希望执行以下格式的 URLmapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/[电子邮件受保护]($b423dcd5)/0/Inbox/ульпали곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤і 갠ラ
,这是我通过 Windows 桌面搜索搜索得到的。
在装有 Outlook 2007 的 Vista 上,如果 Outlook 已打开,则无法打开电子邮件。除非有时,当它因神秘原因而起作用时。
以下是我尝试让它工作的一些方法:
使用 Process.Start
执行它,或通过 cmd.exe / 使用 Process.Start
执行它c 开始。前者冻结了一分钟,然后什么也没做,Process.Start
返回 null(除非 Outlook 尚未打开,但它可以工作)。后者弹出“未指定错误”消息框。
使用协议“mapi:”从 java 打开 Outlook 中的邮件: //"
我不知道如何让这个脚本工作。我生成的 vbs 脚本声称发现了无效字符。另外,这个解决方案让我感到难过。
http://social .msdn.microsoft.com/forums/en-US/windowsdesktopsearchdevelopment/thread/00491710-e245-452f-8b0a-56caa56277e4/ 我怀疑这个解决方案会起作用。但是,由于编译器错误,我无法使其在 C++ 或 C# 中运行。这是一个不确定要包含哪些库或在 C# 中如何通过互操作有效使用 ShellItem2 等的问题。
在目录中创建应用程序快捷方式 我尝试创建一个快捷方式并调用 Process.Start 。这也不起作用,尽管当我双击它时快捷方式本身起作用了。
I wish to execute a URL in the formatmapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/[email protected]($b423dcd5)/0/Inbox/가가가가곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤가갠가
, which I got from searching via Windows Desktop Search.
On Vista with Outlook 2007, this fails to open Emails if outlook is already open. Except sometimes, when it works for mysterious reasons.
Below are some things I've tried in an attempt to get this to work:
Executing it with Process.Start
, or executing it with Process.Start
via cmd.exe /c start. The former froze for a minute, then did nothing, with Process.Start
returning null (except when Outlook was not already open, when it worked). The latter popped up an "Unspecified Error" message box.
Open mails in outlook from java using the protocol "mapi://"
I couldn't figure out how to get this script to work. The vbs scripts I generated claimed to have found invalid characters. Also, this solution makes me sad.
http://social.msdn.microsoft.com/forums/en-US/windowsdesktopsearchdevelopment/thread/00491710-e245-452f-8b0a-56caa56277e4/
I suspect this solution will work. However, I couldn't get it working in C++ or C# due to compiler errors. This is a matter of not being sure which libraries to include or in C# how to effectively use ShellItem2
etc. with interop.
Creating application shortcut in a directory
I tried creating a shortcut and calling Process.Start
on that. This also did not work, though the shortcut itself worked when I double-clicked on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原来问题是 UAC 问题。我倾向于以管理员身份运行 VS,因为有些应用程序需要它。
Turns out the issue was a UAC issue. I tend to run VS as admin, since some apps need it.