Quantcast
Channel: CorelDRAW Community
Viewing all articles
Browse latest Browse all 7339

To Fit Selection VBA help.

$
0
0

Below is a code I have.

 

    Dim s1 As Shape
    Set s1 = ActiveLayer.CreateEllipse2(3.553622, 2.69998, 0.217618, -0.217618, 90#, 90#, False)
    s1.Fill.UniformColor.RGBAssign 255, 20, 61
    s1.Outline.SetNoOutline
    ActiveDocument.ReferencePoint = cdrCenter
    s1.SetSize 0.02, 0.02
    s1.Move 4.5, 5.2

 

We use this a guidline. Basically outlines no thinner than this circle. Anyway - it get's lost behind objects on the page and i'd like .. when we click the macro it automatically zooms in on the circle. We know it's going to a particular part on the page - but this will keep us from losing it.

 

When i record this code is given.

 

Windows.FindWindow("C:\Design\30559-1568545.cdr").ActiveView.ToFitSelection.

 

but i dont want it to pull from a document. I want it to just zoom on selected. I have tried different alterations, but i cannot figure it out. Sometimes i get lucky, but im not having much luck with this.  Help?

 

BAsically.... Something like this

   Dim s1 As Shape
    Set s1 = ActiveLayer.CreateEllipse2(3.553622, 2.69998, 0.217618, -0.217618, 90#, 90#, False)
    s1.Fill.UniformColor.RGBAssign 255, 20, 61
    s1.Outline.SetNoOutline
    ActiveDocument.ReferencePoint = cdrCenter
    s1.SetSize 0.02, 0.02
    s1.Move 4.5, 5.2

' zoom in on selected

 


Viewing all articles
Browse latest Browse all 7339

Trending Articles