I've been doing a little research into the STYLEREF field :
http://office.microsoft.com/en-us/word-help/field-codes-styleref-field-HP005186193.aspx
Trying to answer another question
http://answers.microsoft.com/en-us/office/forum/office_2007-word/word-2007-repeating-outline-heading-1-when-that/5015de6c-ad0c-4ec9-a94a-696c0c8fab30
I'm trying to get the \p parameter working and not having any luck. If I can figure out how to use it I want to try using it in a condition to meet the needs of the original question.
The field by itself { styleref "heading 1" } works as advertised.
If I format the field { styleref "heading 1" \p "above" } In Word 2010 I get following error message:
"Error! Use the Home tab to apply to the text that you want to appear hear". There are 2 spaces between the words "apply" and "to", as if there is an image missing
When I save to DOC format, and view the test doc in 2003 the message changes to "Error! Style not defined". OK, that makes more sense. Except that the style is defined. In 2003 I changed the field to { styleref "heading 1"
\p "Heading 1" }, but that didn't work either. Same style not defined message.
Here is an edit link to the sample file I've been playing with, feel free to make changes, fixes:
https://skydrive.live.com/redir?resid=E9A78C332557256F!307&authkey=!AAVBg4iMkEUeYS8
Bottom line, does anyone know the correct syntax to use the \p parameter?