I need to format several docs every day. They're programs written in Notepad
and any line that starts off with <! is a comment. My job is to copy the
text from Notepad and change all comment lines to be white text with a black
background. Is there some way for Word to do this automatically?
I know there are other programs besides Notepad but this is what I stuck
with doing so I can't change the process.
Thanks
>I need to format several docs every day. They're programs written in
>Notepad
[quoted text clipped - 7 lines]
>
> Thanks
Something like this should do the trick
Sub ReverseComments()
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
If Left$(Trim$(oPara.Range.Text), 2) = "<!" Then
oPara.Range.Font.Color = wdColorWhite
oPara.Range.Shading.ForegroundPatternColor = wdColorBlack
End If
Next oPara
End Sub

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org