Hello,
I am a graphic designer and (very) amateur macro writer. I am looking to select all objects in a given page that have an outline in order to scale them with a selection when it is resized. (Yes this is another issue with global scaling). I am working with x6 and have gotten this far with my code:
ActivePage.DesktopLayer.Editable = False Dim sr As ShapeRange Set sr = ActivePage.Shapes.FindShapes( _ Query:="@Outline.type = 'all'") sr.SetProperties ScaleWithShape:=cdrTrue ActivePage.Shapes.All.CreateSelection ActiveDocument.ReferencePoint = cdrCenter ActiveSelection.SetSize 6#, 6# ActiveSelection.AlignAndDistribute cdrAlignDistributeHAlignLeft, cdrAlignDistributeVAlignTop, cdrAlignShapesToEdgeOfPage, cdrDistributeToSelection, False, cdrTextAlignBoundingBox ActivePage.DesktopLayer.Editable = True
The highlight is where the code is returning:
Run-time error '438'
Object doesn't support this property or method
The debugging skills are not strong with this one. Help me Obi Wan Kenobi, you're my only hope.
??
sr.SetOutlineProperties ScaleWithShape:=cdrTrue
Thank you Myron! That accomplished what I was trying to do. But I have now discovered that this command doesn't do what I expected. It fails to select outline objects altogether so I will start over, do some more research and see if I can get the right structure written in.
The following will find all shapes that have an outline that is not set to scale with object and set the outline to scale with object.
Sub SetScaleWithObject() Dim sr As ShapeRange Set sr = ActivePage.Shapes.FindShapes(Query:="@outline[.type <> 'none' and .ScaleWithObject = 'False']") sr.SetOutlineProperties ScaleWithShape:=cdrTrue End Sub
Good luck on your coding adventures,
-Shelby
Thank you Shelby! I had put this project on hold but this was exactly what I needed to get the module I was working on finished. I appreciate the well wishes. I am enjoying them immensely so far. Happy Halloween!
hi shelby support to corel draw x3