Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-05-2014, 07:32 AM
gmaxey gmaxey is offline Loop through Word doc to find and reformat text Windows 7 32bit Loop through Word doc to find and reformat text Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Something like this provided each cc line constitutes a singe paragraph. Change oDoc to represent your objDoc.

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oDoc As Word.Document
Dim oRng As Word.Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = "cc"
    While .Execute
      If oRng.Start = oRng.Paragraphs(1).Range.Start Then
        With oRng
          .MoveEnd wdParagraph
          With .Font
            .Name = "Times New Roman"
            .Size = 12
          End With
          .Collapse wdCollapseEnd
        End With
      End If
    Wend
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through Word doc to find and reformat text Loop action in Word until not found kilburfi Word VBA 2 07-12-2013 01:26 AM
Loop through Word doc to find and reformat text Reformat line lengths joe925 Word 1 03-18-2013 05:06 PM
reformat file renato Word 1 06-13-2012 06:32 AM
Loop through Word doc to find and reformat text Macro to loop in Word Yamaha Rider Word VBA 2 02-07-2012 05:33 PM
Loop through Word doc to find and reformat text Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft