VSTO的Outlook ItemSend用C# [英] VSTO Outlook ItemSend with C#

查看:265
本文介绍了VSTO的Outlook ItemSend用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Outlook电子邮件的身体的一端与VSTO添加一个字符串

I'm trying to add a string in the end of an Outlook email's body with VSTO

private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        this.Application.ItemSend += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
    }

    void Application_ItemSend(object Item, ref bool Cancel)
    {
        if (Item is Outlook.MailItem)
        {
            Outlook.MailItem mail = (Outlook.MailItem)Item;
            mail.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
            mail.Body += "My Sample Text";
            mail.Save();
        }
    }

当我与F5运行VStudio我的代码,< STRONG>应用程序没有在我的断点处停止和邮件不包含附加行

When i run with F5 my code from VStudio, the app isn't stopping in my breakpoints and the emails do not contain the added line

我能做些什么呢?

注意:我与VS2008的工作,并提前Outlook 2007中

Note: I'm working with VS2008 and Outlook 2007

感谢

推荐答案

对不起...

但问题是我收我的展望与F5重新启动。

The problem was i've to close my outlook and restarted with F5.

如果有人有同样的问题,你现在知道了。

If someone have this same issue, now you know

这篇关于VSTO的Outlook ItemSend用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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