Add a formatting switch:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 7/10/2017
Dim oFld As Field
For Each oFld In ActiveDocument.Fields
If oFld.Type = 3 Then
oFld.Select
If Not InStr(oFld.Code.Text, "\* Lower") > 0 Then
If MsgBox("Format with lower case?", vbQuestion + vbYesNo, "FORMAT") = vbYes Then
If InStr(oFld.Code.Text, "\h") > 0 Then
oFld.Code.Text = Replace(oFld.Code.Text, "\h", "\* Lower \h")
End If
oFld.Update
End If
Else
If MsgBox("Format with upper case?", vbQuestion + vbYesNo, "FORMAT") = vbYes Then
If InStr(oFld.Code.Text, "\h") > 0 Then
oFld.Code.Text = Replace(oFld.Code.Text, "\* Lower \h", "\h")
End If
oFld.Update
End If
End If
End If
Next
End Sub
lbl_Exit:
Exit Sub
End Sub