StyleSheets.Add Method 

Returns a StyleSheet object that represents a new style sheet added to a Web document.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim FileName As String
Dim LinkType As WdStyleSheetLinkType
Dim Title As String
Dim Precedence As WdStyleSheetPrecedence
Dim returnValue As StyleSheet
Dim styleSheets1 As StyleSheets
returnValue = styleSheets1.Add(FileName, LinkType, Title, Precedence)

Syntax

Function Add( _
    <InAttribute()> ByVal FileName As String, _
    <InAttribute()> ByVal LinkType As WdStyleSheetLinkType, _
    <InAttribute()> ByVal Title As String, _
    <InAttribute()> ByVal Precedence As WdStyleSheetPrecedence _
) As StyleSheet
StyleSheet Add(
    [In] string FileName, 
    [In] WdStyleSheetLinkType LinkType, 
    [In] string Title, 
    [In] WdStyleSheetPrecedence Precedence
);
public: StyleSheet^ Add(
    String^ FileName, 
    WdStyleSheetLinkType^ LinkType, 
    String^ Title, 
    WdStyleSheetPrecedence^ Precedence
);
public StyleSheet Add(
    /*in*/System.String FileName, 
    /*in*/WdStyleSheetLinkType LinkType, 
    /*in*/System.String Title, 
    /*in*/WdStyleSheetPrecedence Precedence
);
function Add(
     FileName : String, 
     LinkType : WdStyleSheetLinkType, 
     Title : String, 
     Precedence : WdStyleSheetPrecedence
) : StyleSheet;

Parameters

  • FileName
    Required String. The path and file name of the cascading style sheet.
  • LinkType
    Required WdStyleSheetLinkType. Indicates whether the style sheet should be added as a link or imported into the Web document.

    Can be one of the following constants:

    wdStyleSheetLinkTypeImported

    wdStyleSheetLinkTypeLinkeddefault

  • Title
    Required String. The name of the style sheet.
  • Precedence
    Required WdStyleSheetPrecedence. Indicates the level of importance compared to other cascading style sheets attached to the Web document.

    Can be one of the following constants:

    wdStyleSheetPrecedenceHigher

    wdStyleSheetPrecedenceHighestdefault

    wdStyleSheetPrecedenceLower

    wdStyleSheetPrecedenceLowest

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

StyleSheets Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

StyleSheets Members