Поделиться через


DocumentBase.SaveAsQuickStyleSet Method

Saves the group of quick styles currently in use.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public Sub SaveAsQuickStyleSet ( _
    fileName As String _
)
public void SaveAsQuickStyleSet(
    string fileName
)

Parameters

  • fileName
    Type: System.String
    The full path of the quick style set file.

Examples

The following code example saves the current set of quick styles to a .dotx file and causes Microsoft Office Word to display the new quick style set in the Style Set list. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub SaveQuickStyleSet()
    Dim appDataFolder As String = _
        Environment.ExpandEnvironmentVariables("%APPDATA%")
    Dim quickStyleFile As String = "NewQuickStyleSet.dotx"
    Me.SaveAsQuickStyleSet(appDataFolder + "\Microsoft\QuickStyles\" _
        + quickStyleFile)
End Sub
private void SaveQuickStyleSet()
{                     
    string appDataFolder = 
        Environment.ExpandEnvironmentVariables("%APPDATA%");
    string quickStyleFile = "NewQuickStyleSet.dotx";
    this.SaveAsQuickStyleSet(appDataFolder + @"\Microsoft\QuickStyles\" 
        + quickStyleFile);
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace