![]() |
#1
|
|||
|
|||
![]()
Welcome.
Sir, please tell me how to get an array of words and their initial positions in the document with only the font style? That is, we have a document with as far as styles. we highlight one of the words, and we want to get all the words that have the same style. Trying to describe the right. Code:
Sub Style_work() Dim S As String S = Selection.Text Dim style_1 As Word.Style style_1 = Selection.style If VBA.Len(S) <= 0 Then Exit Sub With ActiveDocument.Find (ActiveDocument=Selection) .style = style1 .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With ActiveDocument.Find.Execute End Sub Anton |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tinfanide | Excel Programming | 4 | 12-26-2012 08:56 PM |
font in style definition trashed | eNGiNe | Word | 1 | 03-30-2012 05:03 AM |
Font style is UNKNOWN | durevcan | Word | 2 | 03-28-2012 09:33 AM |
Why Words doesn’t show the style of the selected words automatically???? | Jamal NUMAN | Word | 0 | 04-14-2011 03:20 PM |
![]() |
licsivaraman | Drawing and Graphics | 2 | 01-24-2011 11:27 PM |