在Outlook中接收邮件时发出警报 [英] Alert while receiving mails in outlook

查看:165
本文介绍了在Outlook中接收邮件时发出警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在接收基于Outlook中主题的电子邮件时发出哔哔声(或发出警报声)?

How to raise a beep (or) any sound like an alert while receiving Emails based on subject in outlook?

推荐答案

您好,

那很容易.只需将对Outlook对象库的引用添加到您的项目中,例如用于Outlook 2007的Microsoft Outlook 12对象库,然后使用以下代码:
Hi,

that is quite easy. Just add a reference to the Outlook Object Library to your project e.g. Microsoft Outlook 12 Object Library for Outlook 2007 and then use the following code:
private Microsoft.Office.Interop.Outlook.Application applicationObject;
public Form1()
{
  InitializeComponent();
  applicationObject = new Microsoft.Office.Interop.Outlook.Application();
  applicationObject.NewMail += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_NewMailEventHandler(applicationObject_NewMail);
}

void applicationObject_NewMail()
{
  Console.Beep(6000, 1000);
}


这篇关于在Outlook中接收邮件时发出警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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