Multi Level Lists

N

Neale

Hi All,

I am trying to export data from a database into a particular section of a
Word document. No problems creating a simple list using the code below, but
I need to create a list with sub-items as a multi-level list.

The following is the code I wrote to create a simple single level list. The
GetExportItems() function returns a single level list, which is then applied
to the range.Text and saved back to the document as a new bookmark.

Set wdRange = wdApp.ActiveDocument.bookmarks("Requirements").Range

strNewText = GetExportItems()

' Update the range with the replacement text and apply bullet style to
the list
wdRange.Text = strNewText

If Forms("Entry-ExportOptions").Form.FrameExportOptions = 1 Then
' Export the data in bullet list format
wdRange.Style = wdStyleListBullet3
Else
' Export the data in number list format
wdRange.Style = wdStyleListNumber3
End If

Can anybody help or suggest how I can achieve this. I have considered
creating two ranges, one with a list at a particular level and the next with
a further indented list (containing the child items), and then append the
ranges together - but I have not had any success with this approach.

Thanks for any help.
 
W

Word Heretic

G'day "Neale" <[email protected]>,

GetExportItems, as it stands, doesn't return a list level for the
item. Ideally, you would create a single list template, link each
level to an appropriate style, then simply set the style dependant on
the level returned by getexportitem or whatever.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Neale reckoned:
 

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