It would be better to have this document set up as a template and for the
code to be run by an autonew macro in the template. Then it would run
whenever a new document is created from the template without the need for
the user to click on any buttons.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I have a document that contains a button that the VBA code goes out to
> a database and collects a unique number. Then it returns the number to
[quoted text clipped - 23 lines]
> ThisDocument.cmdGetNum.Caption = ""
> End Sub
Milo - 15 Aug 2006 17:52 GMT
Doug,
Thanks for the idea, unfortunately the documents that I am copying into
are all ready created, so no new documents would be created for this.
Thanks
> It would be better to have this document set up as a template and for the
> code to be run by an autonew macro in the template. Then it would run
[quoted text clipped - 6 lines]
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
Doug Robbins - Word MVP - 15 Aug 2006 20:21 GMT
Well in that case, I would have the code in an Add-in and a button on the
toolbar to be used for the purpose.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Doug,
>
[quoted text clipped - 13 lines]
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.