Something is missing and I can't figure it out. VBA editor highlights error at this line: Mid(MyString, Counter-1, 1).Paragraphs.Add
and I don't know how could I achieve what I need.
Basically I have to loop through every paragraph and examine the first character of it. For example there will be a pharagraph:
'the show must Go on
And I need to insert a new paragraph before "G", so:
'the show must
Go on
What am I missing?
and I don't know how could I achieve what I need.
Basically I have to loop through every paragraph and examine the first character of it. For example there will be a pharagraph:
'the show must Go on
And I need to insert a new paragraph before "G", so:
'the show must
Go on
What am I missing?
VBA Code:
For Each para In ActiveDocument.Paragraphs
If para.Range.Font.Size = 12 Then
Txt = para.Range.Text
If Left(Txt, 1) = "'" Then
For Counter = 1 To Len(Txt)
If Mid(MyString, Counter, 1) = UCase(Mid(MyString, Counter, 1)) Then
'SOMETHING IS WRONG HERE
Mid(MyString, Counter-1, 1).Paragraphs.Add
End If
Next
End If
End If
Next