API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateGuide method
Creates a guide by using two points
Syntax:
Function CreateGuide(ByVal x1 As Double, ByVal y1 As Double, ByVal x2 As Double, ByVal y2 As Double) As Shape
Parameters:
Name Type Description
x1
Double
y1
Double
x2
Double
y2
Double
Remarks:
The CreateGuide method creates a guideline, at a specified location on a layer, by using two points.
Examples:
The following VBA example divides a page into 4 × 8 rectangles by 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