Thread: [Solved] Styleref field returns error
View Single Post
 
Old 10-21-2018, 12:44 PM
Levi92 Levi92 is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2018
Posts: 4
Levi92 is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
As Paul said, you cannot set this up using any of Word's dialogs. It has to be typed into the document and you need to use Ctrl+F9 to insert the field braces.


Your field does not look like his. It does not have the same structure.


His: {IF{STYLEREF "StyleName"}<> "Error!*" {STYLEREF "StyleName"}}
Yours: {IF STYLEREF 1 = "Error!*", "", STYLEREF 1}


Note the missing braces, and the added commas. Your field does not follow the required field syntax although it would be good as an Excel function or in vba. Remember, too, that the spaces are important.
Thanks for clearing this up. I read Paul's post at least twice but apparently I was blind or stupid or both. It works now!
Reply With Quote