Microsoft Office Tutorials and References
In Depth Information
Data binding to host controls
You can perform these kinds of data manipulations by using .NET programming.
Let's look at a simple example of data manipulation. Here, you will be protecting the
data shown in the Word document by setting it to locked, by using custom code.
Lock control is simply the process of setting the data to read-only,
protecting it from editing by another user.
Change the data item Contentid to be a Combobox control, and place this control in
the document. By using this drop-down box, we can jump to the data items that we
want to view inside the document. We will place the procedure to lock or unlock the
content control inside the Enter event of the content control.
Write a program to create a document in Microsoft Office Word 2007, in the
ThisDocument.cs file.
Let's see the code snippet to lock or unlock the content control of our data item that is
displayed in the document:
// Enter Event of Address Content Control
private void ptAddressCtrl_Entering(object sender, Microsoft.
Office.Tools.Word.ContentControlEnteringEventArgs e)
// Display the dialog window for the edit operation
System.Windows.Forms.DialogResult myResult = new
Search JabSto ::

Custom Search