Hi Folks,
Can anyone help me write a macro to select a rectangle shape with the pick tool after I manually create it? Normally, when you're done creating a rectangle, the rectangle tool remains selected. I'd like it to automatically return to the Pick tool (with the newly created object selected) after manually creating a rectangle.
Thanks very much,
Jack
try
SendKeys (" ")
or
SendKeys Chr$(vbKeySpace)
both worked for me on CD2019
Cool - Thanks for the tip. Would this work with a ShapeCreated event? Any chance for an example of how to implement after a rectangle is created? :-)
Sub Macro1() Dim OrigSelection As ShapeRange Set OrigSelection = ActiveSelectionRange Dim s1 As Shape Set s1 = ActiveLayer.CreateRectangle(1.990303, 4.236996, 6.478492, 1.343295) s1.Rectangle.CornerType = cdrCornerTypeRound s1.Rectangle.RelativeCornerScaling = True s1.Fill.ApplyNoFill s1.Outline.SetPropertiesEx 0.007874, OutlineStyles(0), CreateCMYKColor(0, 0, 0, 100), ArrowHeads(0), ArrowHeads(0), cdrFalse, cdrFalse, cdrOutlineButtLineCaps, cdrOutlineMiterLineJoin, 0#, 100, MiterLimit:=5#, Justification:=cdrOutlineJustificationMiddle
Rem SendKeys (" ")
End Sub
Awesome - Can I use the AddinHook.ShapeCreated to do this when I manually (not programmatically) create a rectangle? I'm not clear on how to make the macro execute after I manually make a rectangle.