Remove Macros from Template

G

Gordon Bentley-Mix

I know this has been asked before, but because I was *so sure* I knew the
answer I never bothered to read any of the posts thoroughly enough to commit
it to memory. Bad move on my part. I'm apparently not as smart as I thought
I was. ;-P

I have a template that contains macros (a couple of code modules and several
UserForms). I now want to use this template differently and no longer need
the code in it. I've removed everything through the VBE and even gone so far
as to save it as .rtf and back as .dot again. Unfortunately, I still get the
macro security warning when I open it or create a new document from it using
standard Word functionality. (Oddly enough, the new method for using this
template involves creating a document from it programmatically, and this
process doesn't invoke the security warning...)

So what else do I need to do to convince Word that this template actually
doesn't contain macros anymore? Or would I be better off just creating the
template from a new blank document? (I'd rather not as duplicating the
formatting is going to be a PITA.)
 
D

Doug Robbins - Word MVP

How about importing the content of the template into a new blank document?

--
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, originally posted via msnews.microsoft.com
 
G

Graham Mayor

Does the document have activex controls? These will flag a macro security
warning (though not in RTF format - but will do so again if you save back to
Word format)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
..
 
G

Gordon Bentley-Mix

I know this will work, but this is exactly what I don't want to have to do.
The template contains a good deal of complex formatting, and I don't want to
have to go through all of the work of replicating it in a new doc. I know
the Styles will come across automatically, but then there are the headers
and footers and page layout, etc. It seems to me that I should be able to
just remove the code and have the macro security warning go away.
Unfortunately, that doesn't seem to be the case...
--
Cheers!

Gordon Bentley-Mix

Doug Robbins - Word MVP said:
How about importing the content of the template into a new blank document?

--
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, originally posted via msnews.microsoft.com
 
G

Gordon Bentley-Mix

Nope. No ActiveX controls. Not even form fields. Just bookmarks in the body
of the template and the code modules and UserForms mentioned below.
--
Cheers!

Gordon Bentley-Mix

Graham Mayor said:
Does the document have activex controls? These will flag a macro security
warning (though not in RTF format - but will do so again if you save back
to Word format)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
.
 
D

Doug Robbins - Word MVP

What sort of complex formatting?

How about creating a new template based on the existing template?

--
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, originally posted via msnews.microsoft.com

Gordon Bentley-Mix said:
I know this will work, but this is exactly what I don't want to have to
do. The template contains a good deal of complex formatting, and I don't
want to have to go through all of the work of replicating it in a new doc.
I know the Styles will come across automatically, but then there are the
headers and footers and page layout, etc. It seems to me that I should be
able to just remove the code and have the macro security warning go away.
Unfortunately, that doesn't seem to be the case...
 
G

Gordon Bentley-Mix

I don't get it. Seems to work OK if I remove the macros using Tools |
Macros... and then delete each one individually. However, if I just delete
the code modules and UserForms through the VBE... ~shrug~ Doesn't make sense
to me since I don't have to use Tools | Macros... to get macros into the
template in the first place; it's enough just to open up the VBE and have at
it.

Unfortunately, before I worked this out I tried using the VBE method.
Consequently, I've got one template that still insists it has macros in it
even though it clearly doesn't. Maybe I'll just dump a dummy code module
into it and then delete it out through the Word UI and see if that fixes the
problem.

If all else fails, I guess I could create a new document from the template
(which should just look like the template since there's no code in it to
muck things up), and then use this as the basis for the "replacement"
template. (I assume that's what you meant below. ;-P) Kind of a labourious
process for something that should be simple IMO though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top