If you are running this button from a Word document, then you must already be in Word, so why create a new instance of Word? However when you create a new document using the code Set objDoc = objWord.Documents.Add this creates a document from the normal template which hopefully will not have your button. You need to create a new document from the template containing the button.
In any case you do not really need a button at all. You could use an autonew macro in the template you are creating to call the userform and that template could already have the table which is fixed in your code, so there is no need to build it.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
|