Solved

How to get the original value from a ListBox control in the ContentControlListEntries in Word 2010

Posted on 2010-11-27
1
577 Views
Last Modified: 2012-05-10
I have this simple loop


                                foreach (Word.ContentControlListEntry ddle in word_cc.DropdownListEntries)
                                {
                                    item.FROM_VALUE = ddle.Text;
                                    if (ddle.Value == item.TO_VALUE)
                                    {
                                        ddle.Select();
                                        break;
                                    }
                                }

I'm looking to retrieve the original value of the control before I alter it, so I can set it back as it was if I need to.

.Text return the default value.
.Value returns the value of each possible choice
I need to know the currently selected choice.

Thanks.

Previous questions on the same thread...
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Word/Q_26641105.html

http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_26641446.html


test2.docx
0
Comment
Question by:gswitz
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
Comment Utility
You can use the Range of the control:

strOriginal = word_cc.Range.Text

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now