If I understand that correctly, create an object style for the frames
and add the paragraph style you want to that object style.
Bob Levine wrote:
If I understand that correctly,
I'm not sure you did. I suspect maybe the OP is looking for the Running Header Variable.
And you can't "generate" a text frame by using a style, you can only apply a style to a frame that has been generated. It might be possible to script what you have in mind, but you'd need to provide a lot more detail.
So can you apply an object style/frame style to a pre-existing paragraph style or only the other way around?
An object style can be applied to a frame. Part of that object style can be a paragraph style for the text inside the frame.
This is the kind of thing I'm talking about, roughed out in Word. The difficulty is that there are literally hundreds of these subheadings throughout the document, and I'm not thrilled by the prospect of having to place them all manually. As you can see the objects have fixed width but variable height, with the object right-aligned at the right margin.
Those look to me like Anchored Objects with a custom position. That's another attribute that can be added to an object style. That's how the images and captions were handled here:
This book was done in CS4 before you could drag and drop to anchor, which makes things even easier. The only complication I see here is text wrap, which for custom anchored objects only affects text in lines following the line with the anchor. Note that the anchor point, marked by the Yen symbol, is in front of the word Notes. In your case it might be necessary to add a blank paragraph with leading set to 0 before each paragraph that requires a heading to give it a place to anchor.