Making a macro does not work (I want to automate changing the colour of the inside and outside contour)

Hi.

One thing iam struggling with is changing the outside and inside contour of a drawing.
For example this drawing:  https://www.dropbox.com/s/enafmcx8908rett/Corel%20Draw%20Test%20File.cdr?dl=0

I cannot just mark everything and hit the left mouse button, then click on the new colour - and click the right mouse button to change the colour of the outside contour.
The problem is... corel adds an additional outside contour. So the font-thickness changes. It's too thick.

I can do it like this:

https://www.youtube.com/watch?v=d8i6YYTX4xM

But it would be cool if I can automate it - as I always just need to change the colour in corel.
Somehow when recording the steps wich the macro recorder it does not work:

https://www.youtube.com/watch?v=9OxKhZ8xyTc

Any ideas?

Thanks!


Parents
  • Not everything that you can do in CorelDRAW can be successfully recorded as a VBA macro.

    For that particular task, it might work to write macro subs to "filter" the current selection to only keep (1) objects with no fill or (2) objects with no outline. After adjusting the selection in that way, you could then apply the outline or fill that you wanted.

    This is not very "polished" code. There is no error handling, and it might not work with all types of content.

    Sub filter_sel_to_no_outline()
    
        ActiveSelectionRange.Shapes.FindShapes(query:="@com.outline.type = " & cdrNoOutline).CreateSelection
        Refresh
    End Sub
    
    Sub filter_sel_to_no_fill()
    
        ActiveSelectionRange.Shapes.FindShapes(query:="@com.fill.type = " & cdrNoFill).CreateSelection
        Refresh
    End Sub
    

    This shows those two macro subs being used on the document you shared: