Couple of other things you might consider.
1) Use calls to functions to do standard things like validate a unique title:
HTML Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strTitle As String
strTitle = "Name"
'Is this a unique titled? Check with function
If fcn_IsTitleUnique(strTitle) Then
Debug.Print "Yep it is."
Else
Debug.Print "Nope its not."
End If
End Sub
Function fcn_IsTitleUnique(ByRef strTitlePassed As String) As Boolean
Dim oCol As New Collection
Dim oCC As ContentControl
fcn_IsTitleUnique = True
For Each oCC In ActiveDocument.ContentControls
oCol.Add oCC.Title, oCC.Title
Next oCC
On Error Resume Next
oCol.Add strTitlePassed, strTitlePassed
If Err.Number = 0 Then fcn_IsTitleUnique = True
On Error GoTo 0
lbl_Exit:
Exit Function
End Function
2) You can simplify InputBox code using StrPtr. This lets you determine between user pressing "Cancel" or not making an entry:
HTML Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strDemo As String
Dim bVillageIdiotNeedsHelp As Boolean
bVillageIdiotNeedsHelp = False
Do
If Not bVillageIdiotNeedsHelp Then
strDemo = InputBox("Enter your name")
bVillageIdiotNeedsHelp = True
Else
strDemo = InputBox("You have an name even if it is Village Idiot." & vbCr + vbCr _
& "Please enter your name!")
End If
'User cancels.
If StrPtr(strDemo) = 0 Then GoTo lbl_Exit
Loop Until strDemo <> ""
lbl_Exit:
Exit Sub
End Sub