Consulting

Results 1 to 3 of 3

Thread: Solved: StoryRanges Object

  1. #1
    VBAX Regular
    Joined
    Oct 2006
    Posts
    30
    Location

    Solved: StoryRanges Object

    I have a 20 page Document that also has footnotes, endnotes and many TextBoxes (Insert=>Textbox). Every Page has 2 Unlinked TextBoxes and 2 TextBoxes that are linked through the whole Document. I want to search through all the text in the whole doc, so I tried using the storyRanges Collection. for example,

    For each astory in activeDocument.StoryRanges
    .........(Search Info).........
    Next aStory

    what happens is that is scrolls through the maintext, endnotes, footnotes and some other stuff but only includes 1 unlinked TextBox on first Page of Doc. Why is that, and is there any other way to get it all without going from shape to shape.

    I tested by sticking in macro
    aStory.Select
    and by watching in watch debugger window the storyType
    and only one TextBox was selected

  2. #2
    VBAX Regular
    Joined
    Oct 2006
    Posts
    30
    Location
    I think I got it. StoryRanges only includes the first of each StoryType. For the rest of the stories it's neccesary to use NextStoryRange Method.
    See article http://word.mvps.org/FAQs/Customizat...ceAnywhere.htm for more info. Thanks

  3. #3
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Thank you for following up your own post. Excellent! That is what we like to see.

    And yes, that only-look-in-the-first-object is a real pain.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •