Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Microsoft Word VBA code for Comment to JSON
Sub ListComments()
Dim x As Document
Set doc = Word.ActiveDocument
For k = 1 To doc.Comments.Count
Dim co As Comment
Set co = doc.Comments(k)
t = Selection.Text
Dim jsonItems As New Collection
Dim jsonDictionary As Dictionary
Dim jsonFileObject As FileSystemObject
Dim jsonFileExport As TextStream
set jsonDictionary = new
jsonItems = "ciao"
Set jsonFileExport = jsonFileObject.CreateTextFile("/tmp/out.json", True)
jsonFileExport.WriteLine (JsonConverter.ConvertToJson(jsonItems, Whitespace:=3))
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.