How can I put a running Heading 2 in a header?

I want to use a field or any other technique that will cause the most recent Heading 2 text to appear in the running header until the next Heading 2 appears.

I’ve tried to follow the instructions from this previous discussion, but I’m not even able to do what the respondent claims can be done: How do I make a Running Header with two different Chapter Fields. I can insert the frame in the header as described, put the cursor in the frame, select Insert/Field, and … I’m right back where I started. I can insert a field for the chapter title, but not for a Heading 1 or 2.

How can I do that? Surely this is a problem that has been solved, it is a common need for documents of any complexity. Thanks for all suggestions.

–Affability

In the “More field” dialogue, select the Document tab → under Format pick “Chapter name” → under Level, select 2.

Note: in the thread you linked, the frame is anchored to the footer and then positioned to replace the header.

Thank you! That did it!