Public Sub ex1()
Dim intWordCount As Integer
Dim rng As range
Dim strTemp As String
Dim i As Integer
intWordCount = ActiveDocument.Words.Count
Set rng = ActiveDocument.Paragraphs(1).range
For i = intWordCount To 1 Step -1
strTemp = ActiveDocument.Words.Item(i)
If i = intWordCount - 1 Then strTemp = StrConv(strTemp, vbProperCase)
If i = 1 Then strTemp = Trim(strTemp): strTemp = LCase(Left(strTemp, 1)) & Mid(strTemp, 2, Len(strTemp) - 2) & LCase(Right(strTemp, 1))
rng.InsertAfter strTemp
Next
End Sub
|