home *** CD-ROM | disk | FTP | other *** search
- Const F2 = 113
- Const F3 = 114
- Const F4 = 115
-
- ' This is also in globals - it will be used to attach to the current session of Word Pro
- Dim CrntWPSession As WPApplication
-
- Sub Main
- ' Set our variable to the current session
- Set CrntWPSession = .Application
- ' Attach our event to Word Pro's keystroke event
- On Event KeyStroke From CrntWPSession Call MyKeyStroke
- End Sub
-
- Sub MyKeyStroke(Source As Wpapplication, Key As Integer, Modifier As Integer, Receivinglayout As String)
- ' If they hit the [F2] key
- Select Case Key
- Case F2
- ' change the style to Default Text
- .Text.ParagraphStyleName = "Default Text"
- End 2
- Case F3
- ' change the style to Body Single
- .Text.ParagraphStyleName = "Body Single"
- End 2
- Case F4
- ' change the style to Bullet 1
- .Text.ParagraphStyleName = "Bullet 1"
- End 2
- End Select
- End Sub
-
-