So I've been trying to make a macro for Microsoft Word for fun recently, but I've hit a bit of a roadblock. What I'm trying to do is actually just to cover the entire page in shapes, but not have them overlap. Currently, the shapes just end up going in a straight line between the top left and bottom right corners, nowhere else, and constantly overlap. I was wondering if there's anyway to accomplish the shapes being on the whole page without overlapping? My script is:
Sub Wait(n As Long)
Dim t As Date
t = Now
Do
DoEvents
Loop Until Now >= DateAdd("s", n, t)
End Sub
Sub Pause()
Wait 0.1
End Sub
Sub Test()
Dim shpCanvas As Shape
Dim shpCanvasShapes As CanvasShapes
Dim shpCnvItem As Shape
ShapeSize = 250 * Rnd() + 250
Set shpCanvas = ActiveDocument _
.Shapes.AddCanvas(Left:=ShapeSize, Top:=ShapeSize, _
Width:=50, Height:=75)
Set shpCanvasShapes = shpCanvas.CanvasItems
With shpCanvasShapes
.AddShape Type:=msoShapeIsoscelesTriangle, _
Left:=0, Top:=0, Width:=50, Height:=50
.AddShape Type:=msoShapeOval, _
Left:=10, Top:=25, Width:=30, Height:=10
.AddShape Type:=msoShapeOval, _
Left:=20, Top:=25, Width:=10, Height:=10
End With
Pause
End Sub
Thanks a bunch, Xander