I want to use Document Properties that are passed down from a document content type from Sharepoint in IF-Statements in Word (Field Codes). The goal is to automate contract creation using a template and sharepoint data from a library.
Though within the template I want to have multiple IF-Fields to correctly change the content according to Gender etc.
My problem is that I can easily add the document properties using Quick Parts > Document Properties, but when I create a new Field code (CTRL-F9) and write:
{ IF { DOCPROPERTY Anrede } = "Herr" "männlich" "weiblich" }
it keeps returning "ERROR! Unknown document property name".
Whenever I just use Quick Parts, the information is always there and correct, so I am completely confused why it won't work with field codes.
UPDATE:
So now I tried { Set Anrede "[Anrede]" }
([Anrede] being a Quick Part Document Property)
But when I try and REF it in an IF function, like:
{ IF { REF Anrede } = "Herr" "männlich" "weiblich" }
the result doesn't change when the input does..
Thanks in advance for any help!
I did not write the braces out by hand, but always used CTRL-F9