You could try this, which I think works logically but may grind to a halt in
a large document. I may have made the wrong assumptions about what you want,
particularly at the detailed level, e.g. what happens if the table is split
across pages (that could be pretty difficult to deal with even if the
following is close to what you need, you could always try repeating the
appropriate Type-level SEQ in every row in the table, but you might end up
with an awful lot of fields).
At the beginning of the document, put the following fields:
{ SET Name0 "" }{ SET Desc0 "" }
Wherever you have a Style 1/Style 2 combination, use the following instead
{ SEQ Item }{ SET "Name{ SEQ Item \c }" "the item name, e.g. Item A" }{ REF
"Name{ SEQ Item \c }"}
{ SET "Desc{ SEQ Item \c }" "the item description" }{ REF "Desc{ SEQ Item
\c }"}
At the beginning of the first Style 3 within each Item, use
{ SEQ "Type{ SEQ "P{ PAGE }" }" \r0 }
At the beginning of each subsequent Style 3 within each Item, use
{ SEQ "Type{ SEQ "P{ PAGE }" }" \r{ SEQ Item \c } }
In the header, put
{ REF "Name{ SEQ Type1 \c }" }
{ REF "Desc{ SEQ Type1 \c }" }
Select the body of the document and press F9, then ditto for the header.
The general idea is that you need something that can remember
a. whether or not the first "type" on a page is the first type within an
item. If it is, you do not want the item name and description as I am
assuming that they will already be immediately above the type line. If it is
not, you want the name and description in the header
b. what the current item name and description are.
Using a SEQ field called P{ PAGE } makes it easy to set up a sequence that
restarts at the top of a page, so it's easy to set up a value that records
something about the first "Type" paragraph on the page. Experience suggests
that using SEQ fields to capture this info. works more reliably than SET
(and IF) when you want to re-use the value in a header.
NB, if you start attempting variations on this technique, it's useful to
know that if you have multiple instances of a field such as { SEQ abc } on a
page, when you use { SEQ abc \c }in a header, Word always seems to use the
/last/ value on the page.
Whenever I do these things I always look at them and wonder whether there
isn't some obvious simplification. Then I decide that there probably isn't
:-)

Signature
Peter Jamieson
> I'm trying to figure out how to place text in a header based on a
> StyleRef, but I can't seem to come up with a way to get the results that
> I want.
>
> I managed to find a post from over a year ago that came close to what I
> wanted, however the solution given doesn't work quite as well as I'd like:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=exNjBg%239CHA.2552%40
TK2MSFTNGP09.phx.gbl&rnum=2&prev=/&frame=on
> I have data that looks like the following:
>
[quoted text clipped - 60 lines]
> Tim Tucker
> tim@timtucker.com
Charles Kenyon - 31 Jul 2004 01:50 GMT
Wow!!!
Charles Kenyon
> You could try this, which I think works logically but may grind to a halt in
> a large document. I may have made the wrong assumptions about what you want,
[quoted text clipped - 58 lines]
> > I managed to find a post from over a year ago that came close to what I
> > wanted, however the solution given doesn't work quite as well as I'd like:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=exNjBg%239CHA.2552%40
TK2MSFTNGP09.phx.gbl&rnum=2&prev=/&frame=on
> > I have data that looks like the following:
> >
[quoted text clipped - 60 lines]
> > Tim Tucker
> > tim@timtucker.com