Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

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



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

          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:vb.net
|title=vb.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)
        
Signature
C#C#
Wiki Markup
{description}
{excerpt}Represents a table cell in a table in the Word document.{excerpt}
{signature:C#}
 public sealed class TableCell : Element
Signature
{signature}{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
{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 [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\).
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle
Properties

...

Name

...

Description

...

CellWidthUnits

...

{code}

{example}
{properties}
||Name||Description||
|[CellWidthUnits|TableCell.CellWidthUnits]|{excerpt-include:TableCell.CellWidthUnits

...

FirstMerged

|nopanel=true}|
|[FirstMerged|TableCell.FirstMerged]|{excerpt-include

...

:TableCell.FirstMerged

...

FirstVerticalMerged

|nopanel=true}|
|[FirstVerticalMerged|TableCell.FirstVerticalMerged]|{excerpt-include

...

:TableCell.FirstVerticalMerged

...

Merged

|nopanel=true}|
|[Merged|TableCell.Merged]|{excerpt-include

...

:TableCell.Merged

...

NoWrap

|nopanel=true}|
|[NoWrap|TableCell.NoWrap]|{excerpt-include

...

:TableCell.NoWrap

...

PreferredWidth

|nopanel=true}|
|[PreferredWidth|TableCell.PreferredWidth]|{excerpt-include

...

:TableCell.PreferredWidth

...

Shading

|nopanel=true}|
|[Shading|TableCell.Shading]|{excerpt-include

...

:TableCell.Shading

...

VertAlignment

|nopanel=true}|
|[VertAlignment|TableCell.VertAlignment]|{excerpt-include

...

:TableCell.VertAlignment

...

VerticalMerged

|nopanel=true}|
|[VerticalMerged|TableCell.VerticalMerged]|{excerpt-include

...

:TableCell.VerticalMerged

...

Methods

...

Name

...

Description

|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)

...

|TableCell.GetBorder(Border.Location)

...

]|{excerpt-include:TableCell.GetBorder(Border.Location)

...

|nopanel

...

=true}|
|[GetPadding(TableCell.Location)

...

|TableCell.GetPadding(TableCell.Location)

...

]|{excerpt-include:TableCell.GetPadding(TableCell.Location)

...

|nopanel

...

=true}|
|[SetPadding(TableCell.Location, Int32)

...

|TableCell.SetPadding(TableCell.Location, Int32)

...

]|{excerpt-include:TableCell.SetPadding(TableCell.Location, Int32)

...

|nopanel

...

Classes

...

Name

...

Description

...

Location

...

=true}|
{classes}
||Name||Description||
|[Location|TableCell.Location]|{excerpt-include:TableCell.Location

...

VerticalAlignment

|nopanel=true}|
|[VerticalAlignment|TableCell.VerticalAlignment]|{excerpt-include

...

:TableCell.VerticalAlignment

...

WidthUnits

|nopanel=true}|
|[WidthUnits|TableCell.WidthUnits]|{excerpt-include

...

:TableCell.WidthUnits

...

|nopanel=true}|