![]() |
#2
|
||||
|
||||
![]()
The text in your pasted extract is not RGB(112,48,160) You need to check that - I recommend Color Cop -, however
Code:
Sub Macro1() Dim oTarget As Document Dim oDoc As Document Dim oRng As Range, oEnd As Range Set oDoc = ActiveDocument Set oTarget = Documents.Add Set oRng = oDoc.Range With oRng.Find .Font.Color = RGB(128, 0, 128) .Text = "" Do While .Execute oRng.MoveEndUntil Chr(13) oRng.End = oRng.End + 1 oRng.MoveEndUntil Chr(13) Set oEnd = oTarget.Range oEnd.Collapse 0 oEnd.FormattedText = oRng.FormattedText oEnd.Collapse 0 oEnd.InsertParagraphAfter oRng.Collapse 0 Loop End With oTarget.Activate lbl_Exit: Set oTarget = Nothing Set oDoc = Nothing Set oRng = Nothing Set oEnd = Nothing Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
copy/paste changes text color !!! | yvessr | Word | 8 | 07-16-2019 02:44 PM |
Content control font color | rkferguson | Word VBA | 1 | 12-18-2018 05:06 AM |
![]() |
Document Specialist | Word | 2 | 08-17-2018 05:25 AM |
![]() |
jackcoletti | Word | 3 | 02-01-2017 08:10 AM |
![]() |
jperez84 | Word VBA | 10 | 09-19-2012 04:48 PM |