I need some help with VBA post to SLACK using markdowns. I have made a macro that sends text to my Slack channel, but I was not able to find the right way to makdown my text so that output to slack would be posted in a formatted manner showing hyperlinked text but not the whole text string, or would post an image but not image url.
Here is my working code below.
Sub BOT_SLACK_POST()
Dim HTTP As Object, Htmldoc As New HTMLDocument
Set HTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
Dim send_text As String
send_text = "<https://stackoverflow.com/questions/ask|Ask a public question> \n :star: Text in a new line \n https://cormullion.github.io/assets/images/slackmojif/slackanimation.gif"
Dim URL$, body$
JBody = "{""Contents"":""" & send_text & """}"
URL = "My_Slack_Channel_Webhook_URL"
HTTP.Open "POST", URL
HTTP.setRequestHeader "Content-Type", "application/json"
HTTP.send JBody
End Sub
This is how the output to Slack channel looks.
Any advise is much appreciated.