View Single Post
 
Old 11-29-2023, 01:21 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default Macro to return a specific character in a specific paragraph.

I'm trying to devise a code to return a specific character in a specific paragraph. Can someone help? Thanks!
Code:
Sub ChrSix()
'The sixth character in the first word of paragraph 5 is "." (Title.)
  With ActiveDocument
 If .Paragraphs(5).Range.Words(1).Characters(6) = "." Then
MsgBox "Found"
 Else
MsgBox "Not Found"
End If
  End With
End Sub
Reply With Quote