參考:http://white5168.blogspot.com/2017/01/line-notify-6-line-notify.html#.Yh63k09BzX4
只需修改sToken 與 sFilepath填入你自已的Token與圖檔放置的位置就可以直接執行。
參考:http://white5168.blogspot.com/2017/01/line-notify-6-line-notify.html#.Yh63k09BzX4
只需修改sToken 與 sFilepath填入你自已的Token與圖檔放置的位置就可以直接執行。
Sub line_notify()
'===================================
'Line訊息
'===================================
Dim oXML As Object
Dim Token As String
Dim URL As String
'指定的Line Notify Token
Token = "你的TOKEN"
'Line Notify的傳送訊息網址
Line_Message = "利用VBA傳訊息"
URL = "https://notify-api.line.me/api/notify"
Set oXML = CreateObject("Microsoft.XMLHTTP")
With oXML
'使用同步傳輸
.Open "POST", URL, 0
'設定傳送封包Header
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "Authorization", "Bearer " & Token
'執行Ajax傳送
.send "message=" & Chr(10) & Line_Message
Debug.Print oXML.responseText
End With
'釋放物件資源
Set oXML = Nothing
End Sub