Previous Document Next Document
Layer.CreateGuide

Function CreateGuide(x1 As Double, y1 As Double, x2 As Double, y2 As Double) As Shape

Member of Layer

The CreateGuide method creates a guideline using two points.

Parameters
Description
x1
Defines the x-coordinate for the first point that defines the guideline. This value is measured in document units.
y1
Defines the y-coordinate for the first point that defines the guideline. This value is measured in document units.
x2
Defines the x-coordinate for the second point that defines the guideline. This value is measured in document units.
y2
Defines the y-coordinate for the second point that defines the guideline. This value is measured in document units.

The following code example divides a page into 4 ?8 rectangles using guidelines:

Sub Test() 
 Const sx As Long = 4 
 Const sy As Long = 8 
 Dim i As Long 
 Dim px As Double, py As Double 
 px = ActivePage.SizeWidth 
 py = ActivePage.SizeHeight 
 For i = 0 To sx 
  ActiveLayer.CreateGuide i * px / sx, 0, i * px / sx, py 
 Next i 
 For i = 0 To sy 
  ActiveLayer.CreateGuide 0, i * py / sy, px, i * py / sy 
 Next i 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.