Skip to content

Disable particular word textfield+c#

Deva Subbu

Asked Nov 18, 2010, 8:47 PM EST1 answer
Share
LinkedInX
HI all,
             i have gone through this code sharing its wonderfull, could some body help me how to disable a particular Formfield (ex) lblFaxPhysTo   i have used the below code to disable the control but no luck

loading the document and assigning the values and  all done. am strucked here only

C#
  if (oWordDoc.Bookmarks.Exists("lblFaxPhysTo"))
            {
                object bookmarkName = "lblFaxPhysTo";
               ((Microsoft.Office.Interop.Word.FormField)oWordDoc.FormFields.get_Item(ref bookmarkName)).Enabled = false;
                oWordDoc.Bookmarks.get_Item(ref bookmarkName).Range.Bold = 1;
                oWordDoc.Bookmarks.get_Item(ref bookmarkName).Range.Font.Size = 8;



            }

my requirements are:
* the word document should be read only,and it also should allow some of the fields to edit.... waiting for reply thanks in advance

Thanks,



S.Devanathan

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.