简体   繁体   English

通过Excel发送电子邮件

[英]Sending emails Via Excel

I have been given the task of creating a spread sheet that will take in some cell phone records information. 我已经完成了创建电子表格的任务,该电子表格将包含一些手机记录信息。 We have reports that run everyday to see data usage by each phone(they are exported as a CSV). 我们有每天运行的报告,以查看每部手机的数据使用情况(它们以CSV格式导出)。 we need a way to automate the sending of emails(text messages via email) based on if a cell value is true. 我们需要一种根据单元格值是否为真来自动发送电子邮件(通过电子邮件发送文本消息)的方法。 currently the spread sheet looks like this (Cell are expressedby || ) 当前,电子表格看起来是这样的(单元格用||表示)

|Wireless Number| |无线号码| User_name| 用户名| Billing Cycle Date| 帐单周期日期| Cost Center| 成本中心| Data_Usage| 数据用法| 90%| 90%| 100| 100 | email Address| 邮箱地址| 90% message| 90%留言| 100% message| 100%留言|

I am looking for some VBA code that will run when a marco is called via a button or keyboard short cut that will take in the email address and send a message that is in the 90% o 100% of data use cell. 我正在寻找一些通过按钮或键盘快捷方式调用marco时将运行的VBA代码,这些快捷方式将接收电子邮件地址并发送90%或100%的数据使用单元格中的消息。 any advice would be nice. 任何建议都很好。

Firstly, this question is off-topic (see my comment). 首先,这个问题是题外话(见我的评论)。

What you need to do is break your problem down int concrete steps. 您需要做的是将问题分解为具体步骤。

EG 例如

1) Pass text values to variables 1)将文本值传递给变量
2) Check those variables to see if they meet your filtering requirements (90% <= Cell USage <= 100%) 2)检查这些变量以查看它们是否满足您的过滤要求(90%<=电池使用率<= 100%)
3) Open Outlook 3)打开Outlook
4) Create a new email object 4)创建一个新的电子邮件对象
5) Populate the email with Address and the email body of text 5)使用地址和电子邮件正文填充电子邮件
6) Send the email 6)发送电子邮件

Each of those would make a Question by themselves (possibly more than 1). 每个人都会自己提出一个问题(可能多于1个)。 Break the problem down. 解决问题。 Write what you know how to do. 写你知道该怎么做。 When you get to the point in your code where you can't do the next step, then ask a question about it on SO. 当您到达无法执行下一步的代码时,请在SO上提出有关此问题。

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

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