Page tree

Versions Compared

Key

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

Excerpt

Creates a named global style, which can be bound to cells, areas, ranges, rows, and columns. Any later changes to this style will affect all cells to which the style was assigned.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Creates a named global style, which can be bound to cells, areas, ranges, rows, and columns. Any later changes to this style will affect all cells to which the style was assigned.{excerpt}
{signature:C#}
 public NamedStyle CreateNamedStyle(System.String styleName)
Signature
{signature}{signature:vb.net
vb.net
}
Public Function CreateNamedStyle(ByVal styleName As String) As NamedStyle
Parameters

...

The name of the new style.

Returns

A NamedStyle object which can be assigned to cells, and can be accessed and modified from the generated Excel spreadsheet.

Remarks

To bind a style to a cell or set of cells, use either Style or ApplyStyle. Both are accessible through the following objects: Cell, Area, Range, RowProperties, and ColumnProperties.

Style definitions created by CreateNamedStyle are saved in the generated spreadsheet, and can be accessed and modified when the file is opened in Microsoft Excel. If a style with the same name already exists an exception will be thrown.

{signature}
{parameters}
{param:styleName}The name of the new style.{param}
{returns}A [NamedStyle|NamedStyle] object which can be assigned to cells, and can be accessed and modified from the generated Excel spreadsheet.{returns}
{remarks}To bind a style to a cell or set of cells, use either {{Style}} or  {{ApplyStyle}}.  Both are accessible through the following objects: [Cell|Cell], [Area|Area], [Range|Range],   [RowProperties|RowProperties], and [ColumnProperties|ColumnProperties].

Style definitions created by [CreateNamedStyle|Workbook.CreateNamedStyle(String)] are saved in the generated spreadsheet, and can be accessed and modified when the file is opened in Microsoft Excel. If a style with the same name already exists an exception will be thrown.

{remarks}
{example}{code:csharp|title=C#}
NamedStyle heading1Style = wb.CreateNamedStyle("Heading1");
{code}
{code:vb.net
|title=vb.net
}
Dim heading1Style As NamedStyle = wb.CreateNamedStyle("Heading1"){code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle