c# - C# 使用 .docx 文本内容发送 Windows Mail
问题描述
我需要获取 .docx 格式的文本,然后准备在 windows Mail 应用程序中发送它(不使用 stmp 发送,只需打开 windows Mail 并将单词文本粘贴到正文中)。
我已经尝试使用 Microsoft.Office.Interop.Word 复制粘贴它,但文本未格式化。这是我发送邮件/获取 Word 内容的代码:
谢谢您的帮助 !
Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document doc = app.Documents.Open(fileName);
string allWords = doc.Content.Text;
doc.Close();
app.Quit();
string mailto = string.Format("mailto:{0}?Subject={1}&Body={2}", destinataire.Text, objet.Text, allWords);
mailto = Uri.EscapeUriString(mailto);
System.Diagnostics.Process.Start(mailto);
解决方案
推荐阅读
- css - 每个方格的悬停效果需要的方格多于应有的方格
- java - 无法从 MapActivity 访问可绘制对象
- go - 如何在 Neo4j Go 驱动程序中解析路径
- rust - 有没有替代 `get_or_insert()` 的方法来提取选项的引用
不消耗它? - java - 在 Spring MVC 应用程序中混合 JPA 和响应式代码
- python - 嵌套列表的总最大值
- r - R 如何识别哪一列是我的数据集中的唯一标识符?
- javascript - 坚持理解 Nodejs 上的 asyncHandler
- java - Spring JPA 的最低要求是什么
- linq - Linq groupby 和全局计数(不是每组计数)