简体   繁体   English

如何使用VBA将Excel数据作为图像粘贴到Outlook中?

[英]How to paste Excel data into Outlook as an image using VBA?

I have an Excel sheet with data in a1:q38 that I need to paste into the BODY of an outlook email. 我有一个包含工作表a1:q38中的数据的Excel工作表,需要将其粘贴到Outlook电子邮件的a1:q38中。 Any idea how to do this while not saving the image as a jpg or png? 知道如何在不将图像另存为jpg或png的情况下执行此操作吗?

The Outlook object model provides three main ways for working with item bodies: Outlook对象模型提供了三种使用项目正文的主要方法:

  1. Body . 身体
  2. HTMLBody . HTMLBody
  3. The Word editor. Word编辑器。 The WordEditor property of the Inspector class returns an instance of the Word Document which represents the message body. Inspector类的WordEditor属性返回代表邮件正文的Word Document的实例。 So, you can use the Word object model do whatever you need with the message body . 因此, 您可以使用Word对象模型对消息正文进行任何所需的操作

For example, you can use the Copy method of the Range class from the Excel object model and then use the Paste method of the Range class from the Word object model to paste the copied data in Excel. 例如,您可以使用Excel对象模型中Range类的Copy方法,然后使用Word对象模型中Range类的Paste方法将复制的数据粘贴到Excel中。

See Chapter 17: Working with Item Bodies for more information. 有关更多信息,请参见第17章:使用项目实体

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM