Solved

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

Posted on 2010-11-27
1
581 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
ID: 34224922
You can use the Range of the control:

strOriginal = word_cc.Range.Text

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Allow space in this pattern 2 48
Resolve Dependency Issues 4 47
DateTimepicker 4 33
C# guarantee sql connection close 6 30
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

895 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