Skip to content

VBA-JSON v2.2.0

Compare
Choose a tag to compare
@timhall timhall released this 06 Jun 01:29
· 24 commits to master since this release

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)