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}{signature:
}
Signature
vb.net
vb.net
Public NotInheritable Class TableCell
		Inherits Element
{signature}
{remarks}New table cells are created when you create a new [Table|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 [
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)

|Element.GetElements(Element.Type)]

to

get

all

elements,

of

which

you

can

check

which

ones

are

of

type

[

TableCell

|TableCell]

.

The

following

sample

demonstrates

getting

a

reference

to

a

table

cell

at

column

3

\

(4th

column

\

),

row

2

\

(3rd

row

\

).

{remarks} {example}{code:csharp|title=C#}

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} {code:
Code Block
vb.net
|title=
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)
        
{code} {example} {properties} ||Name||Description|| |[CellWidthUnits|TableCell.CellWidthUnits]|{excerpt-include:TableCell.CellWidthUnits|nopanel=true}| |[FirstMerged|TableCell.FirstMerged]|{excerpt-include:TableCell.FirstMerged|nopanel=true}| |[FirstVerticalMerged|TableCell.FirstVerticalMerged]|{excerpt-include:TableCell.FirstVerticalMerged|nopanel=true}| |[Merged|TableCell.Merged]|{excerpt-include:TableCell.Merged|nopanel=true}| |[NoWrap|TableCell.NoWrap]|{excerpt-include:TableCell.NoWrap|nopanel=true}| |[PreferredWidth|TableCell.PreferredWidth]|{excerpt-include:TableCell.PreferredWidth|nopanel=true}| |[Shading|TableCell.Shading]|{excerpt-include:TableCell.Shading|nopanel=true}| |[VertAlignment|TableCell.VertAlignment]|{excerpt-include:TableCell.VertAlignment|nopanel=true}| |[VerticalMerged|TableCell.VerticalMerged]|{excerpt-include:TableCell.VerticalMerged|nopanel=true}| {methods} ||Name||Description|| |[ApplyFont(Font)|TableCell.ApplyFont(Font)]|{excerpt-include:TableCell.ApplyFont(Font)|nopanel=true}| |[ApplyParagraphFormatting(ParagraphFormatting)|TableCell.ApplyParagraphFormatting(ParagraphFormatting)]|{excerpt-include:TableCell.ApplyParagraphFormatting(ParagraphFormatting)|nopanel=true}| |[GetBorder(Border.Location)|
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)

...

nopanel

...

...

Excerpt Include
TableCell.GetPadding(TableCell.Location)

...

TableCell.GetPadding(TableCell.Location)

...

nopanel

...

...

...

Excerpt Include
TableCell.SetPadding(TableCell.Location,

...

Int32)

...

TableCell.SetPadding(TableCell.Location,

...

Int32)

...

nopanel

...

true
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