Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.8.1
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > WordApplication API > Border

The Border Object


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

You cannot create a Border object using the new keyword. You must reference an existing Border using the Border property method of one of the following classes: Font, CharacterRun, Paragraph, ParagraphFormatting, Section, or TableCell.

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



Examples:

[csharp]
WordApplication app = new WordApplication();
Document doc = app.Open(@"C:\sample.doc");
Border brdr = 
(Table)(doc.Elements(Element.Type.Table)[0]).get_Cell(0, 0).Border;
brdr.LineWidth = 8; // Set Width to 1 point
brdr.Style = Border.LineStyle.Single;
[vbnet]
Dim app As WordApplication = new WordApplication()
Dim doc As Document = app.Open("C:\sample.doc")
Dim brdr As Border = CType(doc.Elements(Element.Type.Table)(0), Table).get_Cell(0, 0).Border
brdr.LineWidth = 8 ' Set Width to 1 point
brdr.Style = Border.LineStyle.Single


Border Enumerations

NameDescription
Border.LineStyleUsed to specify a line style for borders.
Border.LocationUsed to specify the border location


Border Properties

Property Type Access Description
Color System.Drawing.Color read
write

Sets or returns a System.Drawing.Color object that represents the color of this border

HasShadow boolean read
write

Sets or returns a boolean that represents whether or not the border has a shadow effect

LineWidth int read
write

Sets or returns an int that represents the line width of this border in 1/8 points

Padding int read
write

Sets or returns an int that represents the space to maintain between the border and the text in twips

Reverse boolean read
write

Sets or returns a boolean which specifies whether or not the border graphic is reversed

Style Border.LineStyle read
write

Sets or returns a Border.LineStyle object that represents the line style of this border



This object does not have any methods defined.



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.