Document missing code

  • Thread starter Thread starter Chris Wilkinson
  • Start date Start date
C

Chris Wilkinson

hi,

I have a document template which contains ACtiveX Controls and the code
behind them. My problem is that, whe I created a document based on this
template, then sent it (by email) to someone else, then the code was missing,
so the controls do not function. I researched this a little, and discovered
that, unlike Excel, when Word creates a document based on a template it
creates a link between the document and the template, rather than copying
everything from the template into the new document. This strikes me a rather
short-sighted, as it means that if you want to send the document to another
person, then you have to send the template as well. Is there a way to create
the document, including the code behind it, so avoiding the need to send the
template as well.

Chris
 
You can certainly store macros in documents, but if you are using Word 2007
you must save in a file format that supports macros (such as the *.docm file
format or in Word 97-2003 format). You can use the Organizer to copy macro
projects; to display it, press Alt+F8, and then click the Organizer button.

Note, however, that macro security makes it more difficult to deal with code
in documents, because documents don't usually reside in so-called trusted
locations, such as the templates folder.

Therefore, you may find it more convenient to actually distribute the
template file.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
Back
Top