I guess you are trying to use that code in the ThisDocument module or in a Userform. Put the code in an ordinary module.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
|