Build custom index

Y

yuraukar

I probably need to build two custom index for a document.
The document is a list of products where each product has
a name and an order number.

The 1st index should contain a list of all order numbers
AND names ordered by order number, e.g.

AFTZ03 name1.......2,3
AFZZ name2.........6
BGHH34 name3.....4,5,6

I haven't found a way to create this index with word,
because the length of order numbers is not fixed, but the
index should look like a table.

The 2nd index should contain a categorized list of all
order numbers, e.g.

Category 1
AFTZ03 name1........2,3
Category 2
AFZZ name2..........6
BGHH34 name3......4,5,6

Does anyone have a clue how to achieve this?
I am willing to use VBA for this and build the index on
my own. However, if I mark order numbers as index
entries, how do I get the page numbers where the entry
occurs in VBA?
 
M

Margaret Aldis

Hi yuraukar

See answers to points inserted below

yuraukar said:
I probably need to build two custom index for a document.
The document is a list of products where each product has
a name and an order number.

The 1st index should contain a list of all order numbers
AND names ordered by order number, e.g.

AFTZ03 name1.......2,3
AFZZ name2.........6
BGHH34 name3.....4,5,6

I haven't found a way to create this index with word,
because the length of order numbers is not fixed, but the
index should look like a table.

When you insert an index, you can choose to right align page numbers. This
inserts a tab between the entries. Or, if you are inserting the index fields
by hand, have a look at the /e switch.
The 2nd index should contain a categorized list of all
order numbers, e.g.

Category 1
AFTZ03 name1........2,3
Category 2
AFZZ name2..........6
BGHH34 name3......4,5,6

You could do this using the entry:subentry facility in the XE fields.

You may want to create a macro to mark the entries, but I think your first
stop should be to set up some examples by hand to experiment with getting
the control you want. Word's online Help, though lacking in many respects,
does have good reference information on field switches and you learn most by
trying them out.
 
Y

yuraukar

My problem is not the varying distance between the index
entry and the page number. That is of course no problem
with the index. The issue for the first index type is
that I need to show order number and product name in the
index and these two should appear like 2 columns:

AFTZ03 name1.......2,3
AFZZ name2.........6
^
The problem is here

I tried defining a text for the index entries that
contains a tab (AFZZ<tab>name2), but Word converts the
tab into a space in the index.

The second (categorized) index has two problems:
First, the layout is different than in the first index,
yet they should appear in the same document. There is
however only one style that Word uses to generate and
layout the index. Additionally, if I mark entries with a
category, this category will also affect the first index.
It seems impossible to have two different index in one
document.
Second, the layout of the index should really look like a
table, actually like
Category 1
----------------------------
|AFTZ03 |name1 | 2,3|
|AFZZ |name2 | 6|
----------------------------
Category 2
----------------------------
|AFXX |name3 | 2,3|
----------------------------
I really have no clue how to set up index styles to do
this.

So what I am really looking for is a macro that I can
write to generate the index - not too difficult, as all
index entries are from a database anyway. The only
problem there is that I need to find out the page numbers
where an index entry occurs... any hints?
 

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

Similar Threads


Top