VBA代码从Excel复制并粘贴到Outlook [英] VBA Code Copy from Excel and paste into Outlook

查看:1052
本文介绍了VBA代码从Excel复制并粘贴到Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在尝试复制并粘贴excel中的范围。我在下面的参考资料中在线找到了以下代码。代码调试粗体和下划线代码的位置。我尝试了不同的方案来阻止它进行调试,但都没有成功。系统会显示新的
工作簿,但该范围不会粘贴,也无法手动粘贴。 

Hi I'm trying to copy and paste a range in excel. I found the below code online from the reference below. The code debugs where the bold and underline code is. I've tried different scenarios to prevent it from debugging, but have been unsuccessful. The new workbook will appear, but the range does not paste nor am i able to manually paste. 

错误:运行时错误1004:

Error: Run-time error 1004:

该命令不能用于多个选择

The command cannot be used on multiple selections

参考:  HTTPS://www.reddit.com/r/excel/comments/37ppo4/how_to_copy_excel_cells_into_a_outlook_email/

Reference: https://www.reddit.com/r/excel/comments/37ppo4/how_to_copy_excel_cells_into_a_outlook_email/

<跨度风格= "font-size:0.75em">函数RangetoHTML(作为范围)

Function RangetoHTML(rng As Range)

推荐答案

注意有两个子在链接中。 SendMail和RangeToHtml。在RangeToHtml中有一个名为rng的参数。它由SendMail提供。

Note there is two sub in link. SendMail and RangeToHtml. In RangeToHtml there is a parameter called rng. It is supplied by SendMail.

如果你不使用SendMail,你必须通过其他方式提供。

If you do not use SendMail, you have to supply by other way.

其次,函数rangetohtml返回一个HTML文本字符串和SendMail在Mail Body的.HTMLBody属性中使用它。它没有进行任何复制粘贴

Secondly, the function rangetohtml returns a HTML text string and SendMail uses that in .HTMLBody property of Mail Body.It is not doing any copy paste


这篇关于VBA代码从Excel复制并粘贴到Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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