Range selection...

B

Bjørn Nornes

How do I create a Range based on a style, eg. Heading 1, Normal ??

regards
BN !
 
C

Cindy M -WordMVP-

Hi Bjørn,
How do I create a Range based on a style, eg. Heading 1, Normal ??
You don't really give us a lot of information to go on, here... You
should always mention which version of Word (I'm assuming it's Word,
and not Excel) is involved. And can you explain in a bit more detail
what you need to do with such a range?

Based on what you say, my reply would have to be: use Range.Find to
locate the next instance of the style. If Find.Found is true, then
the Range now contains what was found.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30
2003)
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 :)
 
B

Bjørn Nornes

Sorry for the lack of information !

Software involved is : word 2003 Prof. Edition.

What I need to do is, to search for a style, eg. bold, Heading 1 or
whatever,
once found, I want to append an XML childnode to the text of found style.
 
C

Cindy M -WordMVP-

Hi Bjørn,
Software involved is : word 2003 Prof. Edition.

What I need to do is, to search for a style, eg. bold, Heading 1 or
whatever
OK, what you need is Word's FIND property of the Range object.
Roughly:

Do

With rng.Find
.Text = ""
.Format = True
.Style = "Style name"
.Execute
bFound = .Found
If bFound = True Then
'rng is now the found instance of the style range, do what
you need to do here
End If
End With

Loop While bFound

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top