VBA - 宏打开excel文件&根据Excel单元格内容创建电子邮件 [英] VBA - Macro to open excel file & create email based on Excel cell contents
问题描述
您好,再次感谢您抽出时间查看我的问题。
我仍然没有信心使用< acronym title =" visual basic for applications"> VBA< / acronym>但是我试图修改代码以使我能够获得我所追求的功能,但我失败了。
我会尝试将其分解以便于阅读(希望如此)。
目标:
每当用户点击Outlook工具栏上的宏按钮时,它都会打开一个特定的Excel文件,用户选择一个数字和一个项目描述,然后在主题字段中打开一个包含所选数字和项目描述的Outlook电子邮件。
< span style ="text-decoration:underline"> 3个阶段 :
阶段1:
Outlook中的宏按钮打开Excel电子表格。
第2阶段:
$
A) 用户点击在下一个可用的号码上自动输入用户的ID /名称和号码的日期(日期是保持静态,所以当另一个用户打开Excel文件时,
之前用户记录的日期不会改变)。
B) 用户从下拉列表中选择Excel中的项目描述。
C)W 如果用户对选择感到满意,则用户点击
打开 电子邮件,根据模板生成Outlook电子邮件为
。$
第3阶段:
电子邮件将以所选号码打开电子邮件主题中的项目描述。
我有一个带有布局电子邮件屏幕转储的示例电子表格,但是当它无法上传时,它几乎没用$ b 所以我会尝试生成看下面表格中的电子表格......带有样本数据。
Hi again, and thank you for taking the time to check out my problem.
I am still not confident using <acronym title="visual basic for applications">VBA</acronym> but have tried to amend code to enable me to get the functionality I am after, but I have failed.
I'll try to break it down for easier reading (hopefully).
The objective:
Whenever a user clicks on a macro button on the Outlook toolbar, it will open a specific Excel file, whereby the user selects a number and an Item Description which then opens an Outlook email with the selected number and Item Description in the Subject field.
3 stages:
Stage 1:
Macro button in Outlook opens Excel spreadsheet.
Stage 2:
A) User clicks on the next available number which automatically enters the user's ID/Name and the Date the Number is Taken (Date is to remain static so when another user opens the Excel file, the date the
previous users recorded is not changed).
B) User selects Item Description in Excel from dropdown list.
C) When user is satisfied with the selection, the user clicks on
Open email, which generates an Outlook email
based on a template.
Stage 3:
The email opens with the selected number and Item Description in the Subject of the email.
I do have a sample spreadsheet with layout email screen dump but that is of little use when it cant be uploaded
So I'll try to generate the look of the spreadsheet in the table below ... with sample data.
事件# | 采取 | 日期&时间 | 项目说明 | 打开电子邮件 |
Inc201411-0001 | iim | 20/10/14 | 这是来自下拉列表 FROG | 打开电子邮件 |
Inc201411-0002 | bba | 21/10/14 | 这是来自下拉列表 狗 | 打开电子邮件 |
Incident # | Taken By | Date & Time | Item Description | Open Email |
Inc201411-0001 | iim | 20/10/14 | This is from a drop down list FROG | Open Email |
Inc201411-0002 | bba | 21/10/14 | This is from a drop down list Dog |
Open Email |
推荐答案
你好ShyButterfly,
Hi ShyButterfly,
>>类似电子表格的代码是'General'和Worksheet_BeforeDoubleClick <<
>>The code for the similar spreadsheet is Under 'General' and Worksheet_BeforeDoubleClick <<
'一般'是什么意思?我无法完全理解您正在处理的问题。
What did 'General' mean? I am not able to understand exactly the issue you are handling.
>> Outlook< acronym title ="应用程序的visual basic"> VBA< / acronym>代码(宏)模块位于General和basOpenIncidents下:<<
>>The Outlook <acronym title="visual basic for applications">VBA</acronym> code(macro) module is located under General and basOpenIncidents: <<
您能解释下面代码的更多细节吗?
Can you explain more detail about the code below used for?
<acronym title="visual basic for applications">VBA</acronym>
问候& Fei
Regards & Fei
这篇关于VBA - 宏打开excel文件&根据Excel单元格内容创建电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!