Deva Subbu

Deva Subbu

  • NA
  • 40
  • 29.5k

disable particular word textfield+c#

Nov 19 2010 1:47 AM
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

  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

Answers (1)