How to read table cell of MS Word in Rtf using c# ? RRS feed

  • Question

  • I am using this code to do that

    wd.ActiveDocument.Tables[1].Cell(1, 1).Range.Copy();
     IDataObject data = Clipboard.GetDataObject();
     rtfQuestionAns = Convert.ToString(data.GetData(DataFormats.Rtf));

    My problem is that whenever i am trying to show this text (rtfQuestionAns ) in Richtext box ,

    It contains table border too, I don't want to show table border of cell in Richtext box .

    It's very urgent .

    Monday, June 4, 2012 11:55 AM


  • You should be able to get the content of the cell rather than the cell by using something like the following, but you will need to correct the syntax for C# . r is a Word Range.

    r = wd.Activedocument.Tables[1].Cell(1,1).Range

    r = r.End()-1;


    Peter Jamieson

    Tuesday, June 5, 2012 9:13 AM