Can you attach a sample document with the problem? Also the resulting pdf?
Attach a Sample File Demonstrating the Problem - Here's How
Brief answer is that there is no automatic method of removing Frames. However, once you have removed them from the style, they should stay off.
I or someone else could certainly write a macro that removes frames from heading styles, but it would be nice to have a sample document with the problem to make sure the macro matches the problem.
Here is a macro that deletes frames from built-in heading styles. It may mark those styles as in use, though.
Code:
Sub FramesRemoveFromHeadingStyles()
' Charles Kenyon 2023-06-12
' Remove frames from built-in heading styles - may mark styles as "in-use in document, though"
' https://www.msofficeforums.com/175552-post2.html
'
Dim iCount As Long
For iCount = 1 To 9
With ActiveDocument.Styles(iCount)
.Frame.Delete
End With
Next iCount
End Sub
Instructions for Installing Macros from Forums or Websites by Graham Mayor, MVP