The "Display Name" is returned when making a selection in a drop-down list content control, not the value. This is counter-intuitive and makes the "Value" field redundant.
To recreate this issue:
- Open a new Word document and place the cursor in the body of the document.
- Enable the Developer ribbon and click the "Drop-Down List" button.
- Click the "Design Mode" button and select the drop-down list.
- Click the "Properties" button and add the following items to the "Drop-Down List Properties" area:
- Display Name: "One" Value: "Eins"
- Display Name: "Two" Value: "Zwei"
- Display Name: "Three" Value: "Drei"
- Click OK.
- Click the "Design Mode" button on the ribbon
- Open the Review ribbon, click "Protect Document," check the "Allow only this type of editing in thedocument:" and select "Filling in Forms" from the drop-down list.
- Click "Yes, Start Enforcing Protection"
- Click the Drop-Down List and select "Two"
With the "Value" field of this drop-down list set to "Zwei" I would expect "Zwei" to appear in the control but instead "Two" is displayed.
What is the purpose of the Value field if only the Display Name field is used? It would be very helpful to allow someone to choose from the list based on a plain-text description (account names, for instance) but return another value (the account number) when selected.
Is this intended to work this way? If not, how can I accomplish it?
Thank you for your attention and help if you can provide it.
I understand and agree with your intuitive thoughts on how and why the CC Display Text and Value should work as you desire.
From what I have been able to learn is that value field defines what is stored in a customXMLNode if you map the CC to a customXMLPart. For example if you map your test CC (I named it "Number") using my Add-In:
and select "Three" the stored data is "Zwei."
<?xml version="1.0"?><ccMap xmlns="http://gregmaxey/mvps.org/AddInDefaultNameSpace"><CCMapChild_Number>Zwei</CCMapChild_Number></ccMap>
As for selecting a name and displaying an account number I think you would have to link the dropdown value to a plain text controls using the Exit event. Something similiar to the demo here:
Greg Maxey Please visit my website at: http://gregmaxey.mvps.org/word_tips.htm