Document.Styles Property (2007 System)
Gets a Styles collection for the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Styles As Styles
'Usage
Dim instance As Document
Dim value As Styles
value = instance.Styles
[BrowsableAttribute(false)]
public Styles Styles { get; }
[BrowsableAttribute(false)]
public:
property Styles^ Styles {
Styles^ get ();
}
public function get Styles () : Styles
Property Value
Type: Styles
A Styles collection for the document.
Examples
The following code example creates a new style named "myStyle" and sets its font size to 26 points.
This example is for a document-level customization.
Private Sub DocumentStyles()
Dim Indexes As Object = "myStyle"
Dim type As Object = Word.WdStyleType.wdStyleTypeParagraph
Me.Styles.Add("myStyle", type)
Me.Styles.Item(Indexes).Font.Size = 26
End Sub
private void DocumentStyles()
{
object Indexes = "myStyle";
object type = Word.WdStyleType.wdStyleTypeParagraph;
this.Styles.Add("myStyle", ref type);
this.Styles.get_Item(ref Indexes).Font.Size = 26;
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.