I was writing this as a function, so I had hoped to be able to use a call that returned a value, but hey, at least it's working now.
Pass the routine a ModelDoc object, and it will Flatten the model, and return a Boolean success code:
'---------------------------------------------------------------------------------------
' Procedure : Flatten
' DateTime : 4/8/2002 20:33
' Author : rocheey
' Purpose : Flattens a Sheet metal Model, and sets the flattened face to
' normal.
' Comments : Pass the routine a Partdoc/ModelDoc and it will attempt to
' suppress the feature. The Function returns TRUE if successful.
'
'---------------------------------------------------------------------------------------
'
Function Flatten(ModelDoc As Object) As Boolean
Const ParseString As String = "FlatPatternProcessBends" ' CASE SENSITIVE! Do Not Change!
Const NormalView As String = "*Normal To"
Const swDocPART As Long = 1
Dim featCount As Long
Dim Feat As Object, SubFeat As Object
Dim featname As String
Dim Success As Boolean
' check DocType, make sure not AssemblyDoc or DrawingDoc
If ModelDoc.getType <> swDocPART Then Exit Function ' return 0
featCount = ModelDoc.GetFeatureCount ' get number of features to Loop thru
For I% = featCount To 1 Step -1 ' Loop backwards thru the features (starting at bottom)
Set Feat = ModelDoc.FeatureByPositionReverse(featCount - I)
featname = Feat.GetTypeName ' get name of feature TYPE, niot feature name
FoundFeature% = InStr(ParseString, featname) ' is it one of our features?
If FoundFeature% Then
MainFeatName$ = Feat.Name ' yessir, I believe it is.
Exit For ' no sense in looking any further
End If
Next I%
If FoundFeature% = 0 Then Exit Function ' If not Sheet metal related, get outta here
Feat.select (False) ' select the Feature, and toggle suppression in our main feature
If FoundFeature% = 1 Then 'Flat Pattern
If Feat.IsSuppressed Then ' Must UNsuppress flat pattern
Success = ModelDoc.EditUnsuppress2 ' unsupress FLATPATTERN,
Else
Success = True ' its already been done for us

End If
If Not Success Then Exit Function
ElseIf FoundFeature% = 12 Then ' Process bends
If Not (Feat.IsSuppressed) Then ' Must SUPPRESS Process Bends
Success = ModelDoc.Editsuppress2 ' Suppress Feature
Else
Success = True ' its already been done for us

End If
If Not Success Then Exit Function
End If
' Now select the first subfeature
Set SubFeat = Feat.GetFirstSubFeature
Do While Not SubFeat Is Nothing ' While we have a valid Sub-feature
featname = SubFeat.GetTypeName
If featname = "ProfileFeature" Then ' we have our man
SubFeatName$ = SubFeat.Name
FoundFeat% = 1
Exit Do
End If
Set SubFeat = SubFeat.GetNextSubFeature
Loop ' Continue until the last Sub-feature is done
If FoundFeat% = 0 Then Exit Function
ModelDoc.ClearSelection ' clear the selection object
Success = ModelDoc.SelectByID(SubFeatName$, "SKETCH", 0, 0, 0) ' select the sub feature sketch
ModelDoc.ShowNamedView2 NormalView, 0
Flatten = Success
End Function