Hi Andreas,
Yes, it should be possible.
I'd use the Range.Find functionality to search occurrences of the
character style. And the Range.FormattedText property to "copy" the
found range to the end of the document. For the task, I'd probably set
up three range variables:
1. The original range to search
2. The range that will change during the search (when something is
Found)
3. The range at the end of the document
After each successful search, the Range used for Range.Find will change
to the Found text. So you would need to reset it before searching
again. Here's a bit of pseudocode to give you and idea:
Dim rngDocument as Word.Range = oDoc.Content
'you need an independent pointer to the range, so duplicate it
Dim rngSearch as Word.Range = rngDocument.Duplicate
Dim rngEndOfDoc as Word.Range = rngDocument.Duplicate
'The end of the document
rngEndOfDoc.Collapse(Word.WdCollapseDirection.wdCollapseEnd)
Do While rngSearch.Find.Execute('set the parameters here for the Find)
rngEndOfDoc.FormattedText = rngSearch.FormattedText
rngEndOfDoc.Collapse(Word.WdCollapseDirection.wdCollapseEnd)
rngSearch.Collapse(Word.WdCollapseDirection.wdCollapseEnd)
rngSearch.End = rngDocument.End
Loop
Cindy Meister
INTER-Solutions, Switzerlandhttp://homepage.swissonline.ch/cindymeister(last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail