1
我目前有一個VBA代碼,選擇一個自定義範圍,然後通過電子郵件將所選範圍通過電子郵件發送到另一個工作表中。我附上了代碼,但是這個代碼被複制並粘貼了8次(有8個塊)...... Idk如果重要,但只是認爲我應該儘可能多地提供信息。這些是我的兩個問題:VBA代碼顯示電子郵件,而不是自動發送
1)如何顯示在Outlook上的電子郵件窗口,而不是自動發送(我已經嘗試.Item.Display,它不起作用,所以任何替代或任何其他方法,請推薦) 2)如何讓選定的範圍保持其格式(一些文本是紅色的,但一旦在電子郵件中發送則顯示爲默認文本)。
在此先感謝。
For Each aCell In Worksheets("Email List").Range("B3:B" & Cells(Rows.Count, "B").End(xlUp).Row)
If aCell <> "" Then
eTo = eTo & aCell & ";"
End If
Next
eTo = Left(eTo, Len(eTo) - 1)
If IsEmpty(Range("B4")) Then
Else
ActiveSheet.Range("a3", ActiveSheet.Range("e3").End(xlDown)).Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.To = eTo
.Item.Subject = "Allocations - Barclays" & Format(Date, " mm/dd/yyyy")
.Item.Send
End With
End If