![]() |
#1
|
|||
|
|||
![]()
I am beginner in vba hoping for some guidelines to automate my daily task. So, any help would be greatly appreciated.
Here is my code Sub find_and_format() Dim doc As Document Dim rng As Range Set doc = Application.ActiveDocument Set rng = doc.Content With rng.find .ClearFormatting .Text = "Answer" .Style = ActiveDocument.Styles("ans") .Format = False .MatchAllWordForms = False .MatchWildcards = False .MatchCase = False .Wrap = wdFindContinue End With Do Until rng.find.Execute = False Selection.MoveDown unit:=wdParagraph, Count:=1 Selection.Style = ActiveDocument.Styles("t") Selection.MoveDown unit:=wdParagraph, Count:=1 'do while manual numbering is found Do While Selection.Range.ListFormat.ListType = wdListSimpleNumbering ' and then i want to select and change the autonumbering to manual numbering Selection.Range.ListFormat.ConvertNumbersToText Selection.Style = ActiveDocument.Styles("tt") ' or repeat this process until another style is found Loop 'can i access the range between a style to another style and then format it?? Loop 'i have attached a sample file End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Styles in Templates to help format text - Importing and working with Templates | daithy | Word | 2 | 01-03-2020 05:06 PM |
![]() |
LMHmedchem | Word | 2 | 10-22-2014 10:40 AM |
![]() |
cummins | Word | 3 | 08-16-2012 05:34 AM |
Styles format not permanent | Zuca | Word | 1 | 07-02-2010 10:02 PM |
Creating/editting citation format styles | shark0807 | Word | 1 | 10-01-2008 07:12 AM |