View Single Post
  #6   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Jezebel
 
Posts: n/a
Default cross-referencing in callouts

A document consists of a number of types of StoryRange. The For ... each
loop gets the first instance of each *type* of StoryRange, that actually
occurs in the document. In some cases -- as with the MainStory -- there can
be only one range of that type. However with some types -- eg headers and
footers where your document has multiple sections with separately defined
headers, textboxes, etc -- there may be any number of StoryRanges of that
type. Hence the need for the inner Do ... Loop.

In effect the StoryRanges are set up as a set of linked lists: the For ...
Next loop gets the first item in each list. The .NextStoryRange property
points to the next item in that list if there is one.



"Jose Durazo" wrote in message
...
Doug, this suggestion worked. Many thanks!
I changed the code a bit to the following because I believe your original
code would have updated the same "story" multiple times. Did I
misunderstand something?

My changed code:

For Each myStoryRange In ActiveDocument.StoryRanges
myStoryRange.Fields.Update
Next myStoryRange