我正在尝试MailEnvelope从工作簿到Outlook的一系列单元格并保存到草稿。 我从Ron de Bruin http://www.rondebruin.nl/win/s1/outlook/bmail3.htm稍微调整了下面的一些宏,它非常完美。
就像现在这样(只是我编辑过的部分):
With Sendrng .Parent.Select Set rng = ActiveCell .Select ActiveWorkbook.EnvelopeVisible = True With .Parent.MailEnvelope With .Item .To = "" .CC = "" .Subject = "XXX" '.Attachments.Add ("C:\test.txt") .Display .Save .Close olPromtForSave End With End With我只想将.to =“K1”和.cc =“M1:M4”设置为上面的宏,这些是来自同一活动工作簿的单元格,但是稍微调整一下cell.Value和For Each cell In来自此链接的列(“K”)似乎无法正常工作http://www.rondebruin.nl/win/s1/outlook/bmail5.htm 。
谢谢!
I send a range of cells from a workbook to Outlook.
I've tweaked just a little bit the following macro from Ron de Bruin http://www.rondebruin.nl/win/s1/outlook/bmail3.htm.
It's like this now (just the part that I've edited):
With Sendrng .Parent.Select Set rng = ActiveCell .Select ActiveWorkbook.EnvelopeVisible = True With .Parent.MailEnvelope With .Item .To = "" .CC = "" .Subject = "XXX" '.Attachments.Add ("C:\test.txt") .Display .Save .Close olPromtForSave End With End WithI want to set .To = "K1" and .CC = "M1:M4". These are cells from the same active workbook. Tweaking a little bit with the cell.Value and for For Each cell In Columns("K") from this link didn't work http://www.rondebruin.nl/win/s1/outlook/bmail5.htm.
最满意答案
试试这个:
.To = Range("K1") For each cel in Range("M1:M4") Dim sCC as String sCC = sCC & ";" & cel.Value2 Next .CC = Mid(sCC,2) 'to cut off initial ";"Try this:
.To = Range("K1") For each cel in Range("M1:M4") Dim sCC as String sCC = sCC & ";" & cel.Value2 Next .CC = Mid(sCC,2) 'to cut off initial ";"更多推荐
发布评论