.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Word 2003 XML - WordML - Handling legacy Checkbox Controls using C# ASP.NET

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
I managed to set the text value of a Word 2003 form, which is saved from an XML template.  To do this, I created text nodes at various positions that were defined by bookmarks.The problem is with the checkbox controls.  These were added to the Word 2003 template from the developer legacy controls available in the toolbox.  The following is how a checkbox control appears in the XML template (I removed the styling tags for clarity).<w:r wsp:rsidR="00124571">   <w:instrText> FORMCHECKBOX </w:instrText> </w:r> <w:r wsp:rsidR="004B508C">   <w:t> OFF</w:t> </w:r> <w:r wsp:rsidR="00124571">  <w:instrText> FORMCHECKBOX </w:instrText></w:r><w:r wsp:rsidR="004B508C">  <w:t> OFF</w:t></w:r>The code is the same as the above, regardless of whether the checkbox is checked or not.  There is no way (that I see) to set the checked state of the checkbox.  The code above displays fine in Word 2003, and the checkbox can be checked/unchecked in Word.Has anyone had to set a checkbox in WordML before?  I'm trying to stay away from using a reference to the Office component, which Microsoft does not recommend using on a Web server.RegardsSam

View Complete Post

More Related Resource Links

MOSS 2007 and Word/Excel 2003

Hi, I am working with MOSS 2007 and building a context webpart which contains links to various places. One of the the links is trying to go to a Bookmark in a Word 2003 document. Upon attempting this it only goes to the top of the document and not to the expected bookmark location. I then tried to define a named range in an Excel 2003 file and had Sharepoint point to the named range. The same behavior occurred, it simply went to the top of the document. Here is a code snippet which points to the excel name range called Base: <A href="http://tserver4/sites/HALBI/GON/Shared%20Documents/Parts.xls#Base"> Does anyone know of any issues with this scenario? Thanks, Larry          

Enable/Disable controls in a td when checkbox is checked

hi,I have a table with 10 rows.Each row having 3 asp controls (checkbox,textbox and dropdownlist).on pageload all controls except checkboxes should be disabled and If we check any checkbox the controls(textbox and dropdownlist) in that row are should be enable.pls reply me.Thanks in Advance.

Cannot fill-in Word 2003 fill-in form accessed through SharePoint (WSS 3.0) after installing Word 20

We are experiencing problems when opening a fill-in form designed in Word 2003 accessed through a SharePoint (WSS 3.0) document library after installing Word 2007.  Prior to upgrade to Word 2007, the user could open the file in read-only mode, fill-in the fields and without saving the data, print or email the completed form.  Now, in order to be able to fill-in the fields, it appears they must have SharePoint permissions set to "contribute" so that they can "Edit" the file, fill-in the fields, print or email, and then close the file and specifically indicate they do not want to save changes.  Needing advice as this changes our security in SharePoint and adds extra steps for users.  Thanks.

Import Word docs with Metadata into SharePoint 2010 from Windows Server 2003


I need to import 700 Word docs (2003 & 2007) from Windows Server 2003 into a SharePoint Server 2010 library.  I only have a test server to work with right now and want to do as much pre-work before we launch the actual server. 

My goal: When we launch the shpt server, import all docs into a library so that columns propagate with metatdata automatically.

I'm not sure what the best approach is...

Can I can open each doc and add custom properties (maybe with InfoPath) to import as metadata, then import managed metadata through the term store tool and have it associate with the manually entered custom properties? I don't fully understand managed metadata, which might pose a problem.  And before I start importing terms, I thought I should find out if I've completely misunderstood how taxonomies work.

Or I have an excel spreadsheet with info about each doc in columns that can act as metadata. I could upload this as a list then associate each doc with the list.  But it seems wiser to enter the metadata into the documets.  

Is it possible to update my docs in advance so that uploading goes smoothly? I have help now for data entry that I won't have later.

I have no resources to spend on tools, and have to figure out and build this&nbs

Opening Word 2003 document from sharepoint site in word 2010.


When using sharepoint services with word 2003 on an XP machine, everything works fine. We bought some new computers where we now have windows 7 and office 2007/2010. These work perfect too. Even the 64-bit computers.

We are very happy with the new office version, so we decided to upgrade the entire company. As a test, we upgraded 1 PC. But this is not working. So we upgraded office, later we reinstalled it. But nothing helps. This is the problem: I surf to the document click it to open it, and then Word hangs. "contacting server". This is not always the case, sometimes it works, sometimes it doesn't. This even with the same document.

We would really like to upgrade to office 2010 entirely. But we're not going to buy licences we cannot use. Anybody got a solution?

Handling Form Controls After Ajax.BeginForm Submission


Currently I have a comments section integrated into a blog I am writing. 
The comments are Ajaxified, when you post a comment the comment list auto updates with the comment you just added. 
Everything is working great but I would like to do some cleanup after a comment is successfully posted. 
Specifically I would like to disable the textarea and submit button which I would have no issues doing through javascript by using the AjaxOption OnComplete parameter.
To avoid double posts or just plain abuse. I know I will need other safegaurds as well but this is my first step.
The thing is Ajax.BeginForm does not give the form an id or name so I can not reference the form in javascript.
Is there a workaround here? Can I disable these form controls from the controller? 

Here is my code.

<% using (Ajax.BeginForm("Details", new AjaxOptions {UpdateTargetId="divCommentList"})) {%>
    <p>Add Your Own Comment</p>
    <p><%= Html.TextArea("Comment1")%></p>
    <input type="submit" value="Add Comment" id="submit" />
    <% } %>

Word 2003 vs Word 2007 with Sharepoint 2007


My scenario is:

Have SharePoint 2007 website through which we access our Word documents and currently use Word 2003 to open them.  Users who edit documents use check-in and check-out and publish new versions as and when needed.  Users who just use the documents then access these as read only, but are able to make amendments to add names and addresses etc.

We're currently testing Office 2007 as the integration capabilities with SharePoint 2007 are much better, but we have found that users who access the documents as read only can no longer make ANY edits.  The only way they can is to check out the document, which they are not allowed to do as they are not editors.  So basically we have documents created that users cannot use...

In addition, the Word documents we have stored on the SharePoint site have the DLCPolicyLabelValue field in the footer that links to the item properties in the Sharepoint list to provide the barcode value and current version number.  Whilst ok in Word 2003, Word 2007 doesn't allow these fields to update.

How to create a dynamic list of checkbox controls in Infopath


I am relatively new to sharepoint, and since I do not yet have a proper development environment in my current contract, I have had to attempt to produce solutions to various line of business problems using Nintex and Infopath alone.  They are working on getting one created for me but i still can't believe microsoft make you purchase a whole other sharepoint server licence unless you think developing directly on the live server is a good idea, but I digress, thats not the issue I need assistance with.

The current issue I am trying to find a solution for, or atleast the right way to approach, is the creation of a simple form where the user can check off a register of daily tasks completed and submit the form back to sharepoint from a tablet PC.  Each submission is to create a new entry in the DailyRegister list with a handful of other fields like who, where, when, etc.

That is the easy part that I was able to produce with relative ease, but where it gets tricky is they want the list of tasks to be dynamic. 

i.e. A separate sharepoint list that will just hold the list of currently relevant tasks to be included in the form for that day.  Effectively using a 3rd list as the relational reference table between the DailyRegister list and the AvailableTasks list.

I am planning to create the AvailableTasks list to look something like:

COM exception on Win-2003 STD Edition SP2 (For Word Automation)


Hi there,


I have deployed my Web Application (.Net framework 2.0) on Windows Server-2003 STD Edition SP2

and i have also given the Administrator impersonation into web.config

"<identity impersonate="true" userName="user-name" password="password"/>"


and am developing and Word Automation Application which contains only 3 lines of code for time being

 object oMissing = System.Reflection.Missing.Value;
 Microsoft.Office.Interop.Word.ApplicationClass oWord = new Microsoft.Office.Interop.Word.ApplicationClass();
 oWord.Quit(ref oMissing, ref oMissing, ref oMissing);


with the referenc library Microsoft.Ofiice.Interop.Word


which works fine into local system when given with impersonation,   but when deployed the same application onto server and i have also given the server Administrator impersonation but also its not allowing me to access the COM factory and its throwing me the error as


Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154.



am not getting still what more security issue i need to configure onto

SharePoint lookup site columns and Word Content Controls

I discovered that when you bind lookup columns in SharePoint to a Content Type that in turn pushed these properties to the document, the value actually stored is the ID and not the text that is displayed. What is the correct way to use such site columns to enable users to select the data they want to be associated with a document and then to have the display values be populated in the Content Controls?

ItemUpdating not updating Metadata in Word 2003 document


Developing for Share Point 2003 & Office 2003 using VS 2005.

I have created a document library with an added text column "Document No" which is non-mandatory and another column which is a check box called "Register Document" also non-mandatory.

During the ItemUpdating event I check if the "Register Document" flag has been set. If it has been set I create a unique document number and assign it to the "Document No" field in the AfterProperties, I then create a record in a custom list called "Document Register" with details associated with this document.

If when initially adding a document to the library you select "Register document" everything works fine. The "Document No" field shows correctly in the document and everything in our list displays fine, view the document and the property in the meta-data is also fine.

The problem occurs when you do not decide to register the document when originally adding it to the library. In this case "Document No" starts of blank. Then you select "Edit Properties" in Share Point on the document to trigger check out. Select "Register Document" on the properties page and then check in. Within sharepoint the "Document No" field is correctly populated and shows in the list correctly after the check in.

Publishing document updated by Word 2010 in Sharepoint 2003


Hi everyone.

We are using SharePoint Portal Server 2003, and everything worked fine until we started using Office 2010. When document is placed in document workspace and updated by Office 2003 or 2007, it is possible to use "publish to source location" to publish this document from document workspace. But when this same document is udated by Office 2010, publishing to source location is no more available.

I went thru menu's javascript source code and page source code (document workspace) and find out, that after updating by Office 2010 a SourceURL atribut is missing. It looks like the office 2010 makes this file lost track of its own source.

Can anybody help? Thanks a lot

Petr Masek


Dropdown, checkbox and textbox controls in asp.net editable Gridview.

In this article, I will explain how to use dropdown, checkbox and textbox controls in gridview while insert and edit records.

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend