'******************
'* Code for Module1
'******************
Option Explicit
Dim m As Variant
Dim i As Variant
'Thanks to John Walkenbach for illustrating how to do this
'in Excel. Adapted to Word by Brandtrock.
Sub StartDemo()
On Error Resume Next
'twist Word Art1
'WordArt2 text twists slower because it uses an increment of 0.0675
ActiveDocument.Shapes("WordArt 1").Select
m = 1
For i = 1 To 80
Selection.ShapeRange.TextEffect.Tracking = m
m = m + 0.125 'this increments the twist, a smaller number will slow it down.
DoEvents
Next i
For i = 80 To 1 Step -1
Selection.ShapeRange.TextEffect.Tracking = m
m = m - 0.125 'this increments the twist, a smaller number will slow it down.
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
'Spin WordArt2 text
'this cycles faster than the next spin
ActiveDocument.Shapes("WordArt 2").Select
For i = 1 To 8 'controls spin
Selection.ShapeRange.IncrementRotation 45# 'the degree of rotation
'multiplied by the upper bound of the loop should equal 360 in order
'for the WordArt to stop in the right place. A longer loop with a smaller
'angle will slow the animation down.
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
'twist WordArt2 text
'WordArt1 text twists faster because it uses an increment of 0.125
ActiveDocument.Shapes("WordArt 2").Select
m = 1
For i = 1 To 80
Selection.ShapeRange.TextEffect.Tracking = m
m = m + 0.0675 'this increments the twist, a bigger number will speed it up.
DoEvents
Next i
For i = 80 To 1 Step -1
Selection.ShapeRange.TextEffect.Tracking = m
m = m - 0.0675 'this increments the twist, a bigger number will speed it up.
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
'spin WordArt2 text
'this cycles slower than the first spin
ActiveDocument.Shapes("WordArt 2").Select
For i = 1 To 72
Selection.ShapeRange.IncrementRotation 15# 'the degree of rotation
'multiplied by the upper bound of the loop should equal 360 in order
'for the WordArt to stop in the right place. A longer loop with a smaller
'angle will slow the animation down.
DoEvents
Next i
Selection.ShapeRange.TextEffect.Tracking = 1
Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=1, Name:=""
End Sub
'********************
'* Code for ThisDocument
'********************
Option Explicit
Private Sub Document_Open()
StartDemo
End Sub
|