Monday, February 06, 2006

simple MS word macro

Begin with either Alt+F8 or Tools/Macro/Macros...
Type in a name for your macro.
Enter code for you macro, such as:

Sub poly()

Dim x As Integer
x = 0
max = 1000

While x < (max - 1) x = x + 1 Selection.TypeText Text:="coolness for " + CStr(x) + " and " Wend Selection.TypeText Text:="coolness for " + CStr(max) + "." End Sub


CStr() is Words funtion for turning a variable into a string.