Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Represents a table cell in a table in the Word document.

Signature
C#
C#
 public sealed class TableCell : Element
Signature
vb.net
vb.net
Public NotInheritable Class TableCell
		Inherits Element
Remarks

New table cells are created when you create a new Table. They cannot be created independent of a Table using the new keyword.

To retrieve and manipulate a table cell, use array index notation on a Table object. You can also use Element.GetElements(Element.Type.TableCell) to get all elements, of which you can check which ones are of type TableCell.

The following sample demonstrates getting a reference to a table cell at column 3 (4th column), row 2 (3rd row).

Example
Code Block
csharp
csharp
titleC#

          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Table table = (Table)doc.GetElements(Element.Type.Table)[0];
          TableCell cell = table[3, 2];
        
Code Block
vb.net
vb.net
titlevb.net

          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim table As Table = doc.GetElements(Element.Type.Table)(0)
          Dim cell As TableCell = table(3, 2)
        
Properties

Name

Description

CellWidthUnits

Excerpt Include
TableCell.CellWidthUnits
TableCell.CellWidthUnits
nopaneltrue

FirstMerged

Excerpt Include
TableCell.FirstMerged
TableCell.FirstMerged
nopaneltrue

FirstVerticalMerged

Excerpt Include
TableCell.FirstVerticalMerged
TableCell.FirstVerticalMerged
nopaneltrue

Merged

Excerpt Include
TableCell.Merged
TableCell.Merged
nopaneltrue

NoWrap

Excerpt Include
TableCell.NoWrap
TableCell.NoWrap
nopaneltrue

PreferredWidth

Excerpt Include
TableCell.PreferredWidth
TableCell.PreferredWidth
nopaneltrue

Shading

Excerpt Include
TableCell.Shading
TableCell.Shading
nopaneltrue

VertAlignment

Excerpt Include
TableCell.VertAlignment
TableCell.VertAlignment
nopaneltrue

VerticalMerged

Excerpt Include
TableCell.VerticalMerged
TableCell.VerticalMerged
nopaneltrue
Methods

Name

Description

ApplyFont(Font)

Excerpt Include
TableCell.ApplyFont(Font)
TableCell.ApplyFont(Font)
nopaneltrue

ApplyParagraphFormatting(ParagraphFormatting)

Excerpt Include
TableCell.ApplyParagraphFormatting(ParagraphFormatting)
TableCell.ApplyParagraphFormatting(ParagraphFormatting)
nopaneltrue

GetBorder(Border.Location)

Excerpt Include
TableCell.GetBorder(Border.Location)
TableCell.GetBorder(Border.Location)
nopaneltrue

GetPadding(TableCell.Location)

Excerpt Include
TableCell.GetPadding(TableCell.Location)
TableCell.GetPadding(TableCell.Location)
nopaneltrue

SetPadding(TableCell.Location, Int32)

Excerpt Include
TableCell.SetPadding(TableCell.Location, Int32)
TableCell.SetPadding(TableCell.Location, Int32)
nopaneltrue
Classes

Name

Description

Location

Excerpt Include
TableCell.Location
TableCell.Location
nopaneltrue

VerticalAlignment

Excerpt Include
TableCell.VerticalAlignment
TableCell.VerticalAlignment
nopaneltrue

WidthUnits

Excerpt Include
TableCell.WidthUnits
TableCell.WidthUnits
nopaneltrue