Ant*_*des 2 httprequest libreoffice-basic
我想在 LibreOffice 电子表格上编写一个宏,以向 Web URL 发送 HTTP 请求并接收类似 JSON 的响应。我可以使用 LibreOffice 基本宏编程来做到这一点吗?我在哪里可以获得有关 API 的信息。
我真的很感激任何提示。
谢谢
我来不及帮助安东尼奥了,但为了子孙后代……
您可以从 Basic 调用电子表格函数,如开放办公文档中所述。这是一个调用该WEBSERVICE()函数的简单示例:
Function GetWebContent(url As string) As String
On Error GoTo ErrorHandler
Dim funtionAccess As Object
functionAccess = createUnoService("com.sun.star.sheet.FunctionAccess")
GetWebContent = functionAccess.callFunction("WEBSERVICE",Array(url))
Exit Function
ErrorHandler:
GetWebContent = "Error " & Err
End Function
Function Test
Dim url As String
url = "http://www.google.com"
Dim response As String
response = GetWebContent(url)
End Function
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4481 次 |
| 最近记录: |