identifying lists in a selection

B

bonjella

Hello,

I am trying to identify any lists within a selection. The user will
selected some text in a word document (word 2002), then press the
button to launch my macro which should convert the text selected into
HTML :)

But I can't seem to grab hold of any lists within the selection - if
I don't select any text I can use ActiveDocument.lists but there
doesn't seem to be an equilivent command for selection.range.

What I need to be able to do is find a list in the selected text,
enter text before and after the list, and then work through each list
item and do the same e.g.
<ol>
<li>item 1</li>
<li>List 2</li>
</ol>

But if I can't even get hold of my list in the first place, this is
going to be a triffle difficult! Any help, advice or pointers
greatfully received.

Many thanks

Amy - still in the ooo, what does this command do phase of VBA

p.s. yes I know word and HTML don't go together, but this really is the
best solution to my particular problem - at the moment!
 
H

Helmut Weber

Hi,

MsgBox Selection.range.ListParagraphs.Count

should get you started, plus something like

Selection.range.ListParagraphs(x).range.insertbefore ...

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 

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