Surrounding text of specific color

F

fuzzek

Hi folks, I've searched some groups for answer, but couldnt find any.
I have a large document, where some parts of text are in red. Now I
have to export whole document to plain text, but I have to keep the
selection by surrounding it with some tags (like <sel></sel>).


Is there any way I can deal with it without manual work?
 
S

Shasur

Hi

You can probably search for the font in the document and 'tag' it

Sub Color_Red_Text()

Selection.HomeKey wdStory, wdMove
Selection.ClearFormatting
Selection.Find.Font.Color = wdColorRed
Selection.Find.Execute ""
Do Until Selection.Find.Found = False
Selection.InsertBefore "<sel>"
Selection.InsertAfter "</sel>"
Selection.MoveRight
Selection.Find.Execute ""
Loop
End Sub


Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top