View Single Post
 
Old 09-25-2018, 05:27 AM
ashalles135 ashalles135 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Sep 2018
Posts: 4
ashalles135 is on a distinguished road
Default

YES!! So, I kept trying things this morning and eventually got the macro working.

Thank you! I was able to find the piece I needed from within your code.

I added:
Or .Information(wdWithInTable) = True
to the statement that ignores certain things in the document.

Complete macro below:


With ActiveDocument.Content.Find
.ClearFormatting
.Style = wdStyleNormal
Do While .Execute(Forward:=True, Format:=True) = True
With .Parent
If Left(.Text, 1) = vbCr Or Left(.Text, 1) = " " Or Left(.Text, 1) = chr(12) Or .Information(wdWithInTable) = True Then
'do nothing
Else
.InsertBefore "(U) "
End If

If .End = ActiveDocument.Content.End Then
Exit Do
Else
.Move unit:=wdParagraph, Count:=1
End If
End With
Loop
End With
End Sub
Reply With Quote