I'm hoping that there is a way to format a user's input in a TextBox to firstly change each word to ProperCase, then locate the last word in the same TextBox and make that UpperCase.
This is required for the content control named "Keys" in the following:
Sub FillForm()
Dim oCtrl As Control
Dim oCC As ContentControl
Dim lngIndex As Long
Dim strTC As String
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)
ElseIf oCtrl.Name = "txtKeys" Then
Set oCC = ActiveDocument.SelectContentControlsByTag("Keys").Item(1)
oCC.Range.Text = StrConv(oCtrl.Text, vbProperCase)
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
I don't know if there is a way of applying the two to a single Range?