VBA-JSON v2.2.0
Add optional Whitespace
argument to ConvertToJson
for "pretty" printing:
' (from readme example)
Debug.Print JsonConverter.ConvertToJson(Json)
' -> "{"a":123,"b":[1,2,3,4],"c":{"d":456,"e":789}}"
Debug.Print JsonConverter.ConvertToJson(Json, Whitespace:=2)
' ->
' {
' "a": 123,
' "b": [
' 1,
' 2,
' 3,
' 4
' ],
' "c": {
' "d": 456,
' "e": 789
' }
' }
Whitespace
can either be the number of spaces to use per indentation or a string to use (e.g. vbTab
)