Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2022, 02:10 AM
RRB's Avatar
RRB RRB is offline Collecting style text Windows 8 Collecting style text Office 2013
Susan Flamingo
Collecting style text
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 302
RRB is on a distinguished road
Default Collecting style text

Hi friends!

Is there a way that i can automatically scan my doc and extract all the text formatted with a certain char style and put that text at the end of the document?

I know a macro could do this, but I don't know how to write macros :-(

Thank You



Susan
Reply With Quote
  #2  
Old 03-13-2022, 03:24 AM
gmayor's Avatar
gmayor gmayor is offline Collecting style text Windows 10 Collecting style text Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

That should be simple enough. Try the following
Installing Macros

Code:
Sub Macro1()
Const sName As String = "Strong"    ' the name of the character style
Dim orng As Range
    Set orng = ActiveDocument.Range
    With orng.Find
        .Style = sName
        .Text = ""
        Do While .Execute
            ActiveDocument.Range.InsertAfter orng.Text & vbCr
        Loop
    End With
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 03-13-2022, 05:11 AM
RRB's Avatar
RRB RRB is offline Collecting style text Windows 8 Collecting style text Office 2013
Susan Flamingo
Collecting style text
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 302
RRB is on a distinguished road
Default Thank You

Works perfectly. Thank You So much!!

Susan
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Collecting data from a moving field. (I think) dobbin004 Excel 1 01-02-2018 01:03 AM
Collecting style text Macro to search warning text style and replace the text color rohanrohith Word VBA 3 11-27-2014 01:08 PM
Matching text style to drawing object style notarichman PowerPoint 0 03-07-2011 11:34 AM
Collecting Metrics in Project TimJimO Project 0 12-29-2010 12:12 PM
Need to delete style and style text mclan Word 0 08-04-2008 12:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:25 PM.


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