Microsoft Office Tutorials and References
In Depth Information
Example A-1. Displaying Each AutoShape
msoShapeCross (11)
msoShapeHeart (21)
msoShapeRightBrace (32)
msoShapeCube (14)
msoShapeHexagon (10)
msoShapeRightBracket (30)
msoShapeCurvedDownArrow (48)
msoShapeHorizontalScroll (102)
msoShapeRightTriangle (8)
msoShapeCurvedDownRibbon (100)
msoShapeIsoscelesTriangle (7)
msoShapeRoundedRectangle (5)
msoShapeRoundedRectangularCallout
(106)
msoShapeCurvedLeftArrow (46)
msoShapeLeftArrow (34)
msoShapeCurvedRightArrow (45)
msoShapeLeftArrowCallout (54)
msoShapeSmileyFace (17)
msoShapeCurvedUpArrow (47)
msoShapeLeftBrace (31)
msoShapeStripedRightArrow (49)
msoShapeCurvedUpRibbon (99)
msoShapeLeftBracket (29)
msoShapeSun (23)
msoShapeDiamond (4)
msoShapeLeftRightArrow (37)
msoShapeTrapezoid (3)
msoShapeDonut (18)
msoShapeLeftRightArrowCallout (57)
msoShapeUpArrow (35)
msoShapeDoubleBrace (27)
msoShapeLeftRightUpArrow (40)
msoShapeUpArrowCallout (55)
msoShapeDoubleBracket (26)
msoShapeLeftUpArrow (43)
msoShapeUpDownArrow (38)
msoShapeDoubleWave (104)
msoShapeLightningBolt (22)
msoShapeUpDownArrowCallout (58)
msoShapeDownArrow (36)
msoShapeLineCallout1 (109)
msoShapeUpRibbon (97)
msoShapeDownArrowCallout (56)
msoShapeLineCallout1AccentBar (113)
msoShapeUTurnArrow (42)
msoShapeLineCallout1BorderandAccentBar
121) (
msoShapeDownRibbon (98)
msoShapeVerticalScroll (101)
msoShapeExplosion1 (89)
msoShapeLineCallout1NoBorder (117)
msoShapeWave (103)
msoShapeExplosion2 (90)
msoShapeLineCallout2 (110)
msoShapeFlowchartAlternateProcess
(62)
msoShapeLineCallout2AccentBar (114)
The short program in Example A-1 will display each AutoShape, along with its AutoShapeType,
for 0.5 seconds. (It should be run on a blank worksheet. You can interrupt this program at any
time by striking Ctrl-Break.) The Delay subroutine that it calls is shown in Example A-2 .
Example A-1. Displaying Each AutoShape
Sub DisplayAutoShapes()
Dim sh As Shape
Dim i As Integer
Set sh = ActiveSheet.Shapes.AddShape(1, 100, 100, 72, 72)
For i = 1 To 138
sh.AutoShapeType = i
sh.Visible = True
ActiveSheet.Cells(1, 1).Value = sh.AutoShapeType
Delay 0.5
Next i
End Sub
Example A-2. The Delay Procedure
Public Sub Delay(rTime As Single)
'Delay rTime seconds (min=.01, max=300)
Dim OldTime As Variant
'Safty net
If rTime < 0.01 Or rTime > 300 Then rTime = 1
OldTime = Timer
Do
DoEvents
Loop Until Timer - OldTime >= rTime
End Sub
 
 
 
Search JabSto ::




Custom Search