Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swPart As SldWorks.PartDoc
Dim vBody As Variant
Dim swBody As SldWorks.body2
Dim swFace As SldWorks.face2
Dim i As Long
Dim j As Long
Dim nTotArea As Double
Dim nArea(5) As Double
Dim bRet As Boolean
Set swApp = CreateObject("SldWorks.Application")
Set swModel = swApp.ActiveDoc
Set swPart = swModel
For i = 0 To 5
vBody = swPart.GetBodies(i)
If Not IsEmpty(vBody) Then
For j = 0 To UBound(vBody)
Set swBody = vBody(j)
Set swFace = swBody.GetFirstFace
While Not swFace Is Nothing
nArea(i) = nArea(i) + swFace.GetArea
Set swFace = swFace.GetNextFace
Wend
Next j
End If
nTotArea = nTotArea + nArea(i)
Next i
Debug.Print "Total Area = " + Str(nTotArea) + " m^2"
For i = 0 To 5
Debug.Print " Area(" + Str(i) + ") = " + Str(nArea(i)) + " m^2"
Next i
End Sub