C Sharp中的Office编程 [英] Office Programming in C Sharp

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

问题描述

我正在用C Sharp进行一个项目,其中我必须向我的Outlook发送虚拟电子邮件.现在,此电子邮件的正文中应包含一个链接(单击时),该链接应打开一个Outlook表单或html页面.
谁能建议这是否可能,如果可以,怎么办?

在此先感谢

Mini

I am doing a project in C sharp in which I have to send a dummy email to my outlook. Now this email should contain a link in its body (on clicking) which should open a outlook form or an html page.
Could anyone suggest if this is possible and if yes then how?

Thanks in Advance

Mini

推荐答案

// Create an Outlook object
Outlook.Application outlookApp = (Outlook.Application)System.Runtime.InteropServices.Marshal.GetActiveObje t("Outlook.Application");

// Create a mail item
Outlook.MailItem email = (Outlook.MailItem)(outlookApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem));

// Send the mail
email.To = "my.mail@address.com";
email.Send();

// Release the references
System.Runtime.InteropServices.Marshal.ReleaseComObject(email);
System.Runtime.InteropServices.Marshal.ReleaseComObject(outlookApp);


这篇关于C Sharp中的Office编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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