Sub FillForm()
Dim oCtrl As Control
Dim oCC As ContentControl
Dim lngIndex As Long
Dim strTC As String
Dim oRng As Range
With m_oFrm
For Each oCtrl In .Controls
Select Case TypeName(oCtrl)
Case "TextBox"
If oCtrl.Name = "txtDescription" Then
Set oCC = ActiveDocument.SelectContentControlsByTag("Description").Item(1)
oCC.Range.Text = StrConv(oCtrl.Text, vbProperCase)
If oCtrl.Name = "txtKeys" Then
Set oRng = ActiveDocument.SelectContentControlsByTag("Keys").Item(1).Range
oRng.Text = StrConv(oCtrl.Text, vbProperCase)
oRng.Words.Last = UCase(oRng.Words.Last)
ElseIf oCtrl.Name = "txtKeys" And InStr(1, "Yet to be determined.") Then
Set oRng = ActiveDocument.SelectContentControlsByTag("Keys").Item(1).Range
oRng.Text = StrConv(oCtrl.Text, vbLowerCase)
oRng.Words.First = UCase(oRng.Words.First)
End If
Else
ActiveDocument.SelectContentControlsByTag(Replace(oCtrl.Name, "txt", "")).Item(1).Range.Text = oCtrl.Text
End If
End Select
Next oCtrl
End With
lbl_Exit:
Exit Sub
End Sub