In the Type Menu you find text variables, beyond others, you can target them to a Paragraph or Character Style. Of course you have to work with Paragraph Styles.
Thank you for your answer.
I have tried The crossed references, and text variables, but i am clumsy and couldn't get what i wanted. Perhaps you could explain a bit further?
In case there is a doubt about my needs:
Here's the deal:
1.-I want to put headers in the master page right? So they appear in everypage.
2.- But i want those headers to be, in some way, automatically referenced, to the last instance of the style "Title" (For Example); So that, if in the current page, there is a Text "Die 23 Januarii" with the Style "Title" That Text will be placed automatically in the header of the current page. If there is no text with that syle in the page, then it gets the last instance, let´s say, for example in the last page; there is the text "Die 31 Decembris", then that text will be applied to my header.
3.- OR, ANOTHER WAY, (probably a cleaner way) would be to get the section markers to do that. I mean, to get the document to be divided automatically, in section markers, depending on the ocurrences of the Style "Title".
It seems complicated, but i cannot believe Word has it, and InDesign does not seem to have such a thing. I must be wrong! I am sure there's something for that.
- Yes, they have to be on the master, I would recommend to put it on its own layer on the top.
- Check Last in the text variable definition
- Section markers are static and not such a good tool for that.