I think I found a way, but it is a bit fiddly and, I guess, hackish. However, once you've set it up, you can quite quickly apply it to all the headings you have.
Here are the steps:
(For this process it's best to use a fresh text frame to not mess up an existing heading). Create a paragraph style for your type in the desired style. Now add an underlining (this will simulate the box for you). Change the weight and the offset in such a way that the underlining ends up underneath your type and change the color of the underlining to the text box color you're going for.
Open the glyphs panel and find a glyph that somehow resembles the triangle you're looking for. Arrow heads pointing down or diamond shapes should all work. If the font in use doesn't have such a glyph, just use another font. Now insert that glyph in the front of one of your headings.
- Now select that glyph in your paragraph and change the following settings, to make the shape work as an arrow: First set the kerning to a large negative value, like -800, then give it a negative baseline shift (-11 in may case). Now you might not see the shape anymore since it might have the same color as the paper, so give it the same color as your box next.
(If you ever accidentally deselect the glyph and due to the negative kerning have trouble reselecting it, with your insertion point somewhere in the paragraph press Cmd + Y to bring up the story editor to easily select it there).
Go ahead and change the settings some more, so the "arrow" has the shape you want. I changed the horizontal scale to 200% in my case, you might want to play around with the point size, and again with the kerning or baseline shift.
With the character still selected create a new character style for this named "Arrow".
Edit your paragraph style, go to Nested Styles, add a nested Style that puts your Character Style "Arrow" through 1 characters, see screenshot (hey, I fired up my English InDesign CS4 for that Screenshot…). This has the effect that wherever you use your paragraph style "Heading", the first character will automatically have the character style "Arrow".
Now to give your box a bit space to right (left is a bit tricky at this point), type as many spaces (or any sort of fixed spaces) after your heading as you like.
Lastly to give every heading in your document this style, use a GREP search that looks like this:
In the format you put your Heading Style, so it will only search for that. In the "Find what" box you put
.+ which searches for everything in each paragraph (with your Heading style). In the Change to Box, put your arrow glyph (you can just copy it in there), then the amount of spaces you figured out (this will be the space to the left of the box), then
$0 which means now it puts everything behind these spaces that it found earlier. After that you put again your spaces (for the right space of your box).
- Now you can tell it to search the document and change all. Before you leave that window you could also save that query in case you need it later. Now all your headings in the document should be changed and since you have used formats (and a custom GREP search) you could change the parameters later on to have it changed in the document globally.