看板 Office 關於我們 聯絡資訊
請問版上高手,我正在試著撰寫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://www.ptt.cc/bbs/Office/M.1688441001.A.619.html
newacc: 帳號是物件,要用Set .SendUsingAccount 07/04 13:06
newacc: 參考微軟線上說明文件,裡面有範例 07/04 13:07
newacc: https://bit.ly/44a6l0y 07/04 13:07
Rhaegar: 感謝!有成功寫出來了 07/04 18:38