作者Rhaegar (Rhaegar)
看板Office
標題[問題] VBA OUTLOOK 寄件者選擇
時間Tue Jul 4 11:23:19 2023
請問版上高手,我正在試著撰寫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
想請問語法應該如何撰寫?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.216.223.38 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Office/M.1688441001.A.619.html
1F:→ newacc: 帳號是物件,要用Set .SendUsingAccount 07/04 13:06
2F:→ newacc: 參考微軟線上說明文件,裡面有範例 07/04 13:07
4F:→ Rhaegar: 感謝!有成功寫出來了 07/04 18:38