Sub CheckjournalNameConsist()
Dim i As Integer
Dim fso, f, jp, jo As Object
Dim nr, aimT, Keys, value, value1, value2, norName, ISSN As String
Dim json
Dim myrange As New myrange
Dim Rng, wrd As Range
Set fso = CreateObject("Scripting.FileSystemObject")
norName = NormalTemplate.Path & Application.PathSeparator & "journalNameAbbr.json"
Set f = fso.OpenTextFile(norName)
nr = f.readall
f.Close
' Convert the string to JSON data
Set json = CreateObject("Scripting.Dictionary")
Set json = JsonConverter.ParseJson(nr)
If InStr(ActiveDocument.name, "-") = 0 Then
MsgBox "The document name must start with the journal name and split with '-' "
End If
journalName = LCase(Left(ActiveDocument.name, InStr(ActiveDocument.name, "-") - 1))
pageHeader = JsonConverter.ConvertToJson(json(journalName))
pageHeader = Replace(pageHeader, ChrW(34), "")
WordBasic.ViewheaderOnly
ActiveWindow.ActivePane.View.NextHeaderFooter
Selection.MoveEndUntil "2"
If Trim(pageHeader) = Trim(Selection.Text) Then
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.Paragraphs(1).Range.comments.Add ActiveDocument.Paragraphs(1).Range, "Please check if the journal name is the same as in the header and footer of the document"
End If
Selection.HomeKey
MsgBox "Please confrim this Logo is correct"
End Sub