#1
|
|||
|
|||
Range - Start at beginning of doc - End at defined stylename
Hi there, It is possible to select a range that: - Start at beginning of document - End at a paragraph with a defined stylename Thanks for the help |
#2
|
||||
|
||||
This should work
Code:
Sub Find2Style() Dim aRng As Range Set aRng = ActiveDocument.Range With aRng.Find .Text = "" .Replacement.Text = "" .ClearFormatting .Style = ActiveDocument.Styles("Heading 2") .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = False If .Execute Then aRng.Start = 0 aRng.Select Else MsgBox "Style not found" End If End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Hi there,
It does the job, thank you very much |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Start find macro beginning with section 2 | jeffreybrown | Word VBA | 3 | 09-21-2018 04:01 PM |
How to get start and end range indices of a selection | paik1002 | Word VBA | 7 | 07-02-2017 10:44 PM |
Dymanic Range Starting at a Cell Defined by a Count | jap7675 | Excel Programming | 7 | 12-02-2015 02:12 AM |
Data validation list filter with range defined by OFFSET | Mango123 | Excel | 4 | 03-18-2014 02:52 PM |
Range.Information(wdStartOfRangeRowNumber): Application-defined or Object-defined err | tinfanide | Excel Programming | 2 | 06-09-2012 10:19 AM |