View Single Post
 
Old 11-29-2023, 02:56 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,602
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

The "." after Title is not the sixth character for the first word. It is the first characters of the second Word ". "


Code:
Sub ChrSix()
'The sixth character in the first word of paragraph 5 is "." (Title.)
  With ActiveDocument
 If .Paragraphs(5).Range.Words(2).Characters(1) = "." Then
MsgBox "Found"
 Else
MsgBox "Not Found"
End If
  End With
End Sub

See for yourself:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oPar As Paragraph, oWord As Range
  Set oPar = ActiveDocument.Range.Paragraphs(5)
    For Each oWord In oPar.Range.Words
      oWord.Select
    Next
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote