I'm wondering. Are there any Macros that hide objects
https://community.coreldraw.com/talk/coreldraw_graphics_suite_x6/f/coreldraw-graphics-suite-x6/50703/how-do-you-unhide-an-object-using-macros
Hello. I tried. Macro works error on Corel X7. Can someone help me fix the macro to run on Corel x7 not
thank you.
The link you sent. There are 2 scripts
1. Show all hidden objects.
Sub UnHideLayers()For Each lay In ActivePage.LayersIf lay.Name = ActiveLayer.Name Thenlay.Visible = TrueElselay.Visible = TrueEnd IfNext layEnd Sub
==> It works very well
2. I need a script that hides the selected objects. I don't want to hide by "layer"
Can you help me. Thanks
try following code
Sub UnHideLayers()Dim sr As ShapeRangeSet sr = ActiveSelectionRangeActiveDocument.BeginCommandGroup (hide_selected)If sr.Count < 1 ThenMsgBox ("Select some shape/s and run macro again!")ElseFor Each sh In sr sh.Visible = FalseNextEnd IfActiveDocument.EndCommandGroupEnd Sub
Thank you. It is perfect. I want another way of hiding objects. I select the object and run "Macro" the unselected object will be hidden
Sub HideUnselected()Dim sr As ShapeRange, asr As ShapeRangeSet sr = ActiveSelectionRangeSet asr = ActivePage.Shapes.Allasr.RemoveRange srActiveDocument.BeginCommandGroup (hide_unselected)For Each sh In asrsh.Visible = FalseNext
ActiveDocument.EndCommandGroupEnd Sub
Instead of using a for...next loop, could you instead use the ShapeRange.Hide method?
ShapeRange .Hide method is much better solution then a loop. Thanks