new macro - Delete specific StyleSet

Hi.  Is there a macro to delete a specific object style under the 'Style Sets' section called SKU Overline1?

  • You could try this. There is one sub in there for deleting a StyleSet, and another for deleting a Style.

    The names are there as constants; change them as needed.

    JQ_Delete_StyleSet_or_Style_by_Name_2018_08_27_1530.zip

    The code in there:

    Sub Delete_StyleSet_by_Name()
    
    Dim styleThis As Style
    Const strStyleSetName = "SKU Overline1"
    
        Set styleThis = ActiveDocument.StyleSheet.StyleSets.Find(strStyleSetName)
        If styleThis Is Nothing Then
            MsgBox "The StyleSet " & """" & strStyleSetName & """" & " was not found.", vbInformation, "Delete StyleSet by Name"
        Else
            styleThis.Delete
            MsgBox "The StyleSet " & """" & strStyleSetName & """" & " was deleted.", vbInformation, "Delete StyleSet by Name"
        End If
    End Sub
    
    Sub Delete_Style_by_Name()
    
    Dim styleThis As Style
    Const strStyleName = "Elevation Mark"
    
        Set styleThis = ActiveDocument.StyleSheet.Styles.Find(strStyleName)
        If styleThis Is Nothing Then
            MsgBox "The Style " & """" & strStyleName & """" & " was not found.", vbInformation, "Delete Style by Name"
        Else
            styleThis.Delete
            MsgBox "The Style " & """" & strStyleName & """" & " was deleted.", vbInformation, "Delete Style by Name"
        End If
    End Sub