George Lee was telling us:
George Lee nous racontait que :
> I am creating a copy of an existing document with the following code:
>
[quoted text clipped - 5 lines]
> becomes blank, even through the macro being run is in that document.
> How do I prevent the Run Macro from being stripped?
I see two problems, one is probably an oversight on your part when you
posted:
1) Set targetDocument = myDocument.Application
what is "myDocument" in that line?
2) Documents.Add expects a template as a parameter, not a document. You are
using a document, so I would not be surprised that things do not go as you
want... The link between the form fields and their macros are broken when
when Word is forced to create a document from a document as if it was trying
to create a new document from a template.
Why are you doing this? What is your overall goal?

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
George Lee - 25 Apr 2007 16:32 GMT
The first code line example is an oversight. However, the second was
intended. Using a dot file keeps the macro links. Thanks. However, in
general, I use that line to create a copy of a document (as a .doc), rather
than opening the original document. Is that way not perferred?
> George Lee was telling us:
> George Lee nous racontait que :
[quoted text clipped - 22 lines]
>
> Why are you doing this? What is your overall goal?
Jean-Guy Marcil - 25 Apr 2007 20:16 GMT
George Lee was telling us:
George Lee nous racontait que :
> The first code line example is an oversight. However, the second was
> intended. Using a dot file keeps the macro links. Thanks. However, in
> general, I use that line to create a copy of a document (as a .doc),
> rather than opening the original document. Is that way not perferred?
Documents.Add is not intended to be used to make copy of existing documents,
but to create documents from templates,or create templates from templates.
So if you use it to some other end, you may get unexpected behaviour...

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org