タイトルどおりです。
chatgptに書いてもらいました。
Sub SendToTeams()
Dim olApp As Object
Dim olMail As Object
Dim teamsAddress As String
Dim bodyText As String
' Teamsチャネルのメールアドレス
teamsAddress = "xxxx@jp.teams.ms" ' ←ここを書き換える
' 送信するコメント
bodyText = "【自動投稿】" & vbCrLf & _
"処理が完了しました。" & vbCrLf & _
"確認をお願いします。"
' Outlook起動
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
With olMail
.To = teamsAddress
.Subject = "Excel VBAからの通知"
.Body = bodyText
.Send ' ←確認したい場合は .Display に変更
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
