VBA, Quite a challenge for me...

F

Franko

I hope someone can help me with this:

I’ve created a macro within a Ms-Word Document, after I use the macro, I
need to save a copy of this document using a different name (as you can see,
I’m using the original document as a template).

Problem is, that when I open the template based document, the macro is there
too (obviously).
What I need is a way to save a copy of a document, but not the macros that
the document might have.

I was thinking about a second macro that stops the first macro when it
“sees†that the document’s name has changed, but I’m not really sure if this
could be possible.

I’d really appreciate it if anyone could help me with this so-called
“challengeâ€. Thank you
 
J

Jay Freedman

Hi Franko,

The source of the trouble is here:
(as you can see, I'm using the original document as a template).

Don't use a document "as a template", make it a real template. Starting with
your original document, go into File > Save As, set the "Save as type" box
to "Word Template (*.dot)", supply a name, and click Save. When you change
the "Save as type", Word will automatically switch to your Templates folder
and supply the .dot extension.

Now use File > New to create new documents based on that template. When you
save these documents, the macros will stay in the template and won't be
saved in the document. Then you won't have to chase your tail to try to
avoid the current situation.
 
Top