The following VBA examples creates swatches for each color in the default color palette that is open. A rectangle is created for each color in the palette and is then filled with the color. New pages are added if the swatches cannot fit on a single page.
Sub Test()
Dim d As Document
Dim p As Page
Dim c As Color
Dim s As Shape
Const sx As Double = 0.5
Const sy As Double = 0.5
Dim x As Double, y As Double
Dim MaxX As Long, nx As Long
Dim MaxY As Long, ny As Long
x = 0
y = 0
nx = 0
Set d = CreateDocument
d.Unit = cdrInch
Set p = d.ActivePage
MaxX = CLng(p.SizeWidth / sx)
MaxY = CLng(p.SizeHeight / sy)
For Each c In ActivePalette.Colors
Set s = p.ActiveLayer.CreateRectangle(x, y, x + sx, y + sy)
s.Fill.ApplyUniformFill c
x = x + sx
nx = nx + 1
If nx = MaxX Then
nx = 0
x = 0
y = y + sy
ny = ny + 1
If ny = MaxY Then
ny = 0
y = 0
Set p = d.AddPages(1)
End If
End If
Next c
End Sub