Hi Michael,
If what you are trying to do involves creating a cell with a label at the beginning, this can be done with CellFrameLabels in your stylesheet. Let me try to distill things down to a relatively basic example.
In your stylesheet, start by creating a new cell style, say "ExampleItem". Once done, whenever you create a new cell with this style, it will start with the text "Example XX" where "XX" is an autonumbered integer and the text "Example" cannot be directly edited in your notebook (but can be changed in your stylesheet if you decide to change it to "Key Examples" or some such.
Here is a new definition for this style; it goes in your stylesheet:
Cell[StyleData["ExampleItem"],
CellFrameLabels->{{
Cell[
TextData[{
StyleBox["Example ", FontSlant -> "Italic"],
CounterBox["ExampleCounter"], ". "}], CellBaseline -> Baseline], None}, {
None, None}},
CounterIncrements->"ExampleCounter"]
Now, in any notebook that points to a stylesheet containing this style definition, you create a new cell with style "ExampleItem" and it will automatically start with this text and auto-numbered counter. If you unformat the cell, it would look like this:
Cell["", "ExampleItem"]
When you format the cell (Cell > Show Expression) you will see "Example 1. " with what you see coming entirely from your stylesheet definition. If you were to change the stylesheet definition to the following say,
Cell[StyleData["ExampleItem"],
CellFrameLabels->{{
Cell[
TextData[{
StyleBox["Key Example ", FontSlant -> "Italic"],
CounterBox["Chapter"], ".",
CounterBox["ExampleCounter"]}], CellBaseline -> Baseline], None}, {
None, None}},
CounterIncrements->"ExampleCounter"]
then you would have your displayed cell look like
Key Example X.Y
where "X" is now the Chapter counter (if you were using one) and "Y" is your ExampleCounter.
This works well for cells that start with an auto-numbered label like "Example X" or "Theorem Y", or "Part Z". It is quite another matter it you want such an expression embedded in the middle of a Text cell say. It is doable but I think quite a bit more involved.