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

This class is used to specify border settings for various entities in a Word document.

Signature
C#
C#
<p> public sealed class Border</p>
Signature
vb.net
vb.net
<p>Public NotInheritable Class Border</p>
Remarks

You cannot create a Border object using the new keyword. You must reference an existing Border by using either the Border property of the Font class or the GetBorder(Border.Location) method of one of the following classes: ParagraphFormatting, Section or TableCell.

The following sample gets the Border object for the bottom part of the upper left table cell of the first table in a document.

Example
Code Block
csharp
csharp
titleC#

          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Border brdr =
               (Table)(doc.GetElements(Element.Type.Table)[0])[0, 0].GetBorder(Border.Location.Bottom);

          //--- Set Width to 1 point
          brdr.LineWidth = 8;
          brdr.Style = Border.LineStyle.Single;
        
Code Block
vbnet
vbnet
titlevb.net

          Dim app As WordApplication = New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim brdr As Border = _
               doc.GetElements(Element.Type.Table)(0)(0, 0).GetBorder(Border.Location.Bottom)

          '--- Set Width to 1 point
          brdr.LineWidth = 8
          brdr.Style = Border.LineStyle.Single
        
Properties

Name

Description

Color

Excerpt Include
Border.Color
Border.Color
nopaneltrue

HasShadow

Excerpt Include
Border.HasShadow
Border.HasShadow
nopaneltrue

LineWidth

Excerpt Include
Border.LineWidth
Border.LineWidth
nopaneltrue

Padding

Excerpt Include
Border.Padding
Border.Padding
nopaneltrue

Reverse

Excerpt Include
Border.Reverse
Border.Reverse
nopaneltrue

Style

Excerpt Include
Border.Style
Border.Style
nopaneltrue
Classes

Name

Description

LineStyle

Excerpt Include
Border.LineStyle
Border.LineStyle
nopaneltrue

Location

Excerpt Include
Border.Location
Border.Location
nopaneltrue