Private Sub SelectionInverse()Dim SHAPE_BhBp As Shape
For Each SHAPE_BhBp In ActivePage.Shapes
If SHAPE_BhBp.Selected = True ThenSHAPE_BhBp.Selected = FalseElseSHAPE_BhBp.Selected = TrueEnd If
NextEnd Sub
the selected property is to be used only with an object, it doesn't work for selection.
This is a code in C#, which performs the procedure, someone from VBA can easily rewrite it for you
[CgsAddInMacro] public void InvertSelection() { ShapeRange selectedRange, allRange; selectedRange = corelApp.ActiveSelectionRange; allRange = corelApp?.ActivePage.Shapes.All(); allRange.RemoveRange(selectedRange); selectedRange.RemoveFromSelection(); allRange.AddToSelection(); }
Hello, I test this code in CorelDRAW X5 and he work for me well.
I can not understand reason for not working?!
Please explain what happens if not working? Please write error message and row of code where macro stops!
Greetings!
yes working. i just removedthe word PRIVATE. then working