Multiple images export

When I''m designing in CorelDRAW (2017) I always end up grouping stuff together.
For example, I always design symbols in CorelDraw and group the individual objects in one group, so I can copy them and change the color.

Now rather than export each individual symbol (group), I really want a macro which exports each selected symbol (group) as a PNG file with the file name the same as the group name.
For example I have 5 symbols (groups) named: group1, group2, group3, group4, group5.
And when I select only the first 3, I want to run a macro that exports each of those groups as an individual png file with the groupname as the file name (group1.png, group2.png and group3.png).

So far I can loop through each selected group and get the name.
But now I need to export each of them as an image (png).

It seems I'm unable to do that.
I''m only able to export all the selected group as one single image.

I use the 'Shape' object (Visual Basic) for each of the groups.
Is there a way to export that 'Shape' object?

See my code below:

No Data
  • try code below

    Sub exportGroups()
    Dim groups As ShapeRange
    Dim group As Shape
    Dim groupname As String, path As String
    Set groups = ActiveSelectionRange

    For i = 1 To groups.Count
    groupname = groups.Shapes(i).Name
    path = "c:\" & groupname & ".png"
    Set expflt = ActiveDocument.ExportBitmap(path, cdrPNG, cdrSelection, cdrRGBColorImage, 0, 0, 300, 300, cdrNormalAntiAliasing, False, True, True, False, cdrCompressionNone)
    With expflt
    .interlaced = True
    .Transparency = 0
    .invertmask = False
    .Color = 0
    End With
    Next i
    End Sub