Page tree

Versions Compared

Key

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

Excerpt

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



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

          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}
{code:vbnet|title=vb.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
        
Signature
C#C#
Wiki Markup
{description}
{excerpt}This class is used to specify border settings for various entities in a Word document.{excerpt}
{signature:C#}
 public sealed class Border
Signature
{signature}{signature:vb.net
vb.net
}
Public NotInheritable Class Border
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
{signature}
{remarks}You cannot create a [Border|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
csharpcsharp
titleC#
Code Block
vbnetvbnettitle
Properties

...

Name

...

Description

...

Color

...

HasShadow

...

LineWidth

...

Padding

...

Reverse

...

Style

...

Classes

...

Name

...

Description

...

LineStyle

...

Location

...

{code}

{example}
{properties}
|| Name || Description ||
| [Color|Border.Color] | {excerpt-include:Border.Color|nopanel=true} |
| [HasShadow|Border.HasShadow]\\ | {excerpt-include:Border.HasShadow|nopanel=true} |
| [LineWidth|Border.LineWidth]\\ | {excerpt-include:Border.LineWidth|nopanel=true} |
| [Padding|Border.Padding]\\ | {excerpt-include:Border.Padding|nopanel=true} |
| [Reverse|Border.Reverse]\\ | {excerpt-include:Border.Reverse|nopanel=true} |
| [Style|Border.Style]\\ | {excerpt-include:Border.Style|nopanel=true} |
{classes}
|| Name || Description ||
| [LineStyle|Border.LineStyle]\\ | {excerpt-include:Border.LineStyle|nopanel=true} |
| [Location|Border.Location]\\ | {excerpt-include:Border.Location|nopanel=true} |