[問題] VBA OUTLOOK 寄件者選擇

作者: Rhaegar (Rhaegar)   2023-07-04 11:23:19
請問版上高手,我正在試著撰寫VBA批量寄送信件。
但Outlook 內有兩個帳號,預設為1,但需要用帳號2寄送。
但目前嘗試都無法更換,寫法如下
Dim oul As Outlook.Application
Dim olkmail As Object
Set olkmail = oul.CreateItem(0)
With olkmail
.SendUsingAccount = oul.Session.Accounts.Item(2)
.Send
End With
想請問語法應該如何撰寫?
作者: newacc (XD)   2023-07-04 13:06:00
帳號是物件,要用Set .SendUsingAccount參考微軟線上說明文件,裡面有範例https://bit.ly/44a6l0y
作者: Rhaegar (Rhaegar)   2023-07-04 18:38:00
感謝!有成功寫出來了

Links booklink

Contact Us: admin [ a t ] ucptt.com