I don't think it can as docs seem to work on higher level. (TaggingRules).
Also, this example DOES NOT work but is close. I assumed "ExampleSection" | "ExampleSubsection"
have appropriate CounterIncrements
but they do not. If you edit Reference.nb so they have, then you could use this code. Currently it works well only for "NotesSection" | "PrimaryExamplesSection"
and the very first ExampleSection or ExampleSubsection as the counter is fixed at 0.
With[{cell = NextCell[] (*whatever you want*)}
, Module[{ spec, style = First @ Flatten @ {"Style" /. Developer`CellInformation[cell]} }
, spec = Switch[style
, "NotesSection" | "PrimaryExamplesSection", {TaggingRules, "Openers", style}
, "ExampleSection" | "ExampleSubsection", {TaggingRules, "Openers", style, CurrentValue[cell, {"CounterValue", style}]}
, _, False
]
; If[
ListQ @ spec
, CurrentValue[ParentNotebook@cell, spec] = CurrentValue[ParentNotebook@cell, spec] /. {
False -> True, True -> False, Open -> Closed, Closed -> Open
}
]
]
]