Hi =?Utf-8?B?V2lsbGlhbQ==?=,
I'm not clear about how all these things work together, here. you have a
template. In that template you've inserted ActiveX controls, with code? Do you
also have UserForms? Or do you mean something else by "Forms"?
But what's this "document" to which you refer? Are you creating a new document
from the template, then trying to add ActiveX controls to that? Or something
else?
In which code module is the code you show us? Is ActiveDocument supposed to
refer to a document generated from the template, or the template itself? Have
you see the article on using ActiveX controls in Word, on the MSDN site? It
discusses some issue concerned with automating ActiveX controls in documents,
where the code is contained in the attached template.
> G'd morning. In Office 2003, I created a Word template which has a word
> document, VBA code, and couple of FORMs. And, I'm getting very strange error
[quoted text clipped - 19 lines]
> ActiveX obj. Or, I should register the objs before I reference to them in VBA
> code.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
William - 24 Aug 2005 16:47 GMT
Hi Cindy,
the template has couple userforms, modules with VBA code, and ActiveX
controls on the template.
all the changes are made to the template. when a user creates a new doc from
the template, the new doc will have the latest changes to VBA code or ActiveX
contols.
it seems that if i add a new activex control to the template, the old doc
without the new activex control but has a reference to the template is not
working. for example, i created a new obj called address. and, the
txtCompanyName text box obj already existed before. ActiveDocument is the doc
created from the template, and is the active document.
> > the code:
> > ActiveDocument.txtCompanyName.text = "My Company"
> >
> > txtCompanyName is the name of the textbox created before.
> >
> > If I delete the newly created obj from the template, everything works fine.
Thanks,
will

Signature
> Hi =?Utf-8?B?V2lsbGlhbQ==?=,
>
[quoted text clipped - 43 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)