Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-08-2013, 01:29 AM
Kreol2013 Kreol2013 is offline An array of words from a document knowing the font style Windows 7 32bit An array of words from a document knowing the font style Office 2013
Novice
An array of words from a document knowing the font style
 
Join Date: Apr 2013
Posts: 8
Kreol2013 is on a distinguished road
Question An array of words from a document knowing the font style

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
Thank you for your help.
Anton
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
An array of words from a document knowing the font style Convert String Array to Integer Array from a User Input? 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
An array of words from a document knowing the font style How to change font style in wordart.... licsivaraman Drawing and Graphics 2 01-24-2011 11:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:37 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