vbscript 解析JSON-8-18

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript 解析JSON-8-18相关的知识,希望对你有一定的参考价值。

Sub find_abbr_1(ByVal control As IRibbonControl)
Dim f, nr
Dim jsstr As String
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\haha.json")
nr = f.readall
On Error GoTo kr
    Dim a, b As Integer
    a = 1: b = 2
    If a > b Then
kr:
      MsgBox "can't find this abbr"
    End If

Dim scobj As New MSScriptControl.ScriptControl
Dim age As String


scobj.Language = "JavaScript"


scobj.AddCode ("var query = " + nr)

age = scobj.Eval("query[0]." + Selection.Range.Text)
If age = "n.a." Then
MsgBox "this word no abb"
Else
Selection.Text = FunctionGroup.convertUpper(age)
End If

以上是关于vbscript 解析JSON-8-18的主要内容,如果未能解决你的问题,请参考以下文章

vbscript 解析JSON模块

ASP( VBScript ) 解析 JSON

如何以与 VBScript 相同的方式解析命令行

VBScript 执行和评估命令

如何从 cmd 获取变量并在 vbscript 中显示 - Vbscript

vbscript VBScript中