vba - List all instances of the "Heading 1" style -


I'm trying to list every example of the "Heading 1" style within my document (in the end, In the blanket

The following code appears to find examples of "Heading 1", because the correct number of entries listed in the instant window, but .text nothing returned

What am I doing wrong? Thank you.

  Blund as BlindFound Do not slow me as this document with integer i = 1. Search .Style = "Top 1" blnFound =. If exaggeration check blnFound then Print I & amp; "" & Amp;  < I do not believe you have the item The text property selection contains a text image. Try it: 

  Sub FindHeadings () 'October 28, 2014 Dim BlnFull as Setting Boolean Dim I set the' I = I 'integral search criteria Homecanet: = wdStory selection. With ClearFormatti selection Ng Selection.Find.Style = ActiveDocument.Styles ("Heading 1"). Choose. Find out Text = "" .install. Text = "" .pad = wdFindContinue .form = true .MatchCase = False .MatchWholeWord = false .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = Selection.Find.Execute Selection.MoveLeft unit: = wdCharacter, count: Repeat = 1 'when you meet the style blnFound = True, with blnFound selection. Find out. Execute if OK = Debug only. Print I & amp; "" & Amp; Selection. Text I = i + 1 'in the next character selection. Right unit: = wdCharacter, count: = 1 other debug Print "full" blnFound = false end if end ends with  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -