Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: VB.NET
Posted by: userc865b
Added: Aug 20, 2019 8:55 PM
Modified: Aug 20, 2019 9:06 PM
Views: 6
Tags: no tags
  1. ' http://codevba.com/office/read_text_file_into_string_variable.htm#.XVxglugzaUm
  2. Sub sad()
  3.  
  4. Dim myJson As String
  5.  
  6. ' <<<<<<<<<<<<<Ihr Pfad hier >>>>>>>>>>>>>>
  7. Dim strFilename As String: strFilename = "C:\tsconfig.json"
  8. ' <<<<<<<<<<<<<Ihr Pfad hier >>>>>>>>>>>>>>
  9.  
  10. Dim strFileContent As String
  11. Dim iFile As Integer: iFile = FreeFile
  12. Open strFilename For Input As #iFile
  13. strFileContent = Input(LOF(iFile), iFile)
  14.  
  15. Close #iFile
  16.  
  17. Dim Json As Object
  18.  
  19. Set Json = JsonConverter.ParseJson(strFileContent)
  20.  
  21. MsgBox Json("premierFarnellPartNumberReturn")("products")(1)("stock")("level")
  22.  
  23. End Sub