This is the code. It uses two screens. The first is used to initialise some
variables. The second draws the boxes. The only code that really matters is
the Sub DrawBoxes. If the formatting is omitted from this then the boxes draw
fastish otherwise it c r a w l s. In 2003 it goes like the
clappers.
Public mySlide1, mySlide2 As Variant
Public black, white, red, yellow, blue As Long
Sub StartUp()
Set mySlide1 = ActivePresentation.Slides(1)
Set mySlide2 = ActivePresentation.Slides(2)
black = RGB(0, 0, 0)
white = RGB(255, 255, 255)
red = RGB(255, 0, 0)
yellow = RGB(255, 255, 128)
blue = RGB(51, 153, 255)
Test
End Sub
Sub Test()
ClearBoxes
GoToSlide 2
DrawBoxes
GoToSlide 2
End Sub
Sub ClearBoxes()
With mySlide2.Shapes
For intShape = .Count To 1 Step -1
With .Item(intShape)
If .Name <> "NEW" Then .Delete
End With
Next
End With
End Sub
Sub DrawBoxes()
With mySlide2
For Row = 1 To 9
For Col = 1 To 10
xpos = 60 + (Col - 1) * 32
ypos = 100 + 32 * (Row Mod 10)
myN = "B" & Col + 10 * ((Row - 1) Mod 10)
With .Shapes.AddShape(msoShapeRectangle, xpos, ypos, 24, 24)
.Name = myN
.Fill.ForeColor.RGB = blue
With .TextFrame.TextRange
.Text = myN
With .Font
.Name = "Arial"
.Size = 10
.Color.RGB = white
End With
End With
End With
Next Col
Next Row
End With
End Sub
Sub GoToSlide(mySlide)
With SlideShowWindows(1).View
.GoToSlide mySlide
End With
End Sub