This tip can also be applied to Word 2007 and 2010.
It is common (to some of us) to insert text using macros in our documents. Perhaps you need a macro to insert numbers, change a word, or text insertion. Follow the steps below to learn how:
- Each of the VBA lines of code below will insert a different type of text.
- Selection.TypeText Text:=”this text”
- Selection.TypeText Text:=MyText
Each of the above lines inserts something at the current insertion point:
- The first line inserts everything between the quote marks;
- The second inserts the value of the MyText variable; and
- The third inserts a paragraph symbol (an empty line).
I learned this from Allen Wyatt.