Word 2003 Startup Macro Error 91
Posted on 2006-07-10
I'm trying to set up a shortcut to word that includes a macro in the parameter.
I recorderd the macro "macro1" in Word 2003 using the Tools, Macros, Record New Macro menu. Then to test the macro, I tried running the macro from the Start, Run menu as follows:
This is the text of the macro:
' TestMacro Macro
' Macro recorded 7/10/2006 by S Frank Jones
Selection.TypeText Text:= _
"This is my test macro. It runs when I start Word."
Selection.TypeText Text:="This is the last line of the macro."
When I run the command, I get the following error:
"Run Time Error 91:
Object variable or with block variable not set"
Why is this not working? I also tried creating a new "normal.dot" file, but when the macro is recreated with the new normal.dot file, I get the same error. I've also tried running it from a shortcut.
Since I have an immediate need, I'm putting 500 points for this question.