View Single Post
 
Old 05-08-2016, 04:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,340
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The function you posted appears to be an edited variant of code I've posted in threads such as:
https://www.msofficeforums.com/word/24807-how-do-i-convert-line-text-title.html
https://www.msofficeforums.com/word-...html#post55885
It is not deigned to do as you say you want it to and wouldn't even do as it's supposed to with your modifications. For what you say you want, you could use a macro like:
Code:
Sub Reformat()
Dim i As Long, StrChr As String, StrTmp As String
With Selection
  For i = 1 To .Words.Count
    StrChr = Left(.Words(i), 1)
    If StrChr = LCase(StrChr) Then
      StrTmp = StrTmp & LCase(.Words(i))
    Else
      StrTmp = StrTmp & StrChr & LCase(Mid(.Words(i), 2, Len(.Words(i)) - 1))
    End If
  Next
  .Text = StrTmp
End With
End Sub
PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote