How To Find A Macro -- Word 2007

J

Jerry

Our company has several hundred controlled forms that are saved as protected
templates on a server.

Recently, we've had many cases of people trying to open these templates and
getting error messages about macros (Do you want to enable?) even though
there shouldn't be any macros in the forms that are giving the errors.

I know very little (read "less than nothing") about macros. How do you find
and disable an unwanted macro in a document? Where do they hide?

I don't know if it matters, but all of the forms that give these errors have
been recently revised. Our document control department has migrated from
Office 2003 to Office 2007 recently, but since most of the company is still
using 2003, we're saving everything in the older formats. All the documents
have the *.dot extension -- not the *.dotm extension.

Thanks for your help.

Jerry
 
D

Doug Robbins - Word MVP

Your users should not be opening the templates. Rather, they should be
using File>New and then selecting the appropriate template as the basis for
the document that they want to create.

--
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
 
J

Jerry

You may be right, but that doesn't answer my question of how to find out
whether a document has an unwanted macro in it.

Does anybody out there know how to tell whether there's a macro in a
document or know where to find it?
 
J

Jay Freedman

First, let's distinguish between a *document* and a *template*, because that
distinction is critical to Word itself, and using the words interchangeably
is just going to lead us around in circles. According to your original post,
the files you're dealing with are templates, not documents.

Am I correct that the templates (*.dot files) should not contain macros? Is
it also true that they don't (shouldn't) contain any ActiveX controls
(things from the Control Toolbox of Word 2003 or the bottom rows of the
Legacy Controls dropdown in Word 2007)?

If both of those assumptions are true, but you see macro warnings when you
open the templates for editing, then the three main possibilities are:

(a) There really is a macro or an ActiveX control in the template.

(b) Someone in the past added (or recorded) a macro, or inserted an ActiveX
control, and then deleted it; but the file still contains some binary data
that tells Word that the code was once there.

(c) The aforementioned binary data was placed in the file erroneously when
Word 2007 saved the template in Word 2003 format. (This seems unlikely, but
it's still possible.)

If (a) is true, after opening the template you should be able to see a macro
in the macro editor (in the Project Explorer pane of the editor,
double-click each module icon under the template's project name); if there
is code there, right-click the module and choose to remove it. Also, you can
look through the text of the template for any ActiveX control and remove it.

If (b) or (c) is true, the macro warning is the only visible sign of it.

In the bad old days, the only way to cure a lingering macro warning was to
save the template (or document) was to save it in a format that has no way
to store macros, such as RTF; then open that file and resave it in the *.dot
(or *.doc) format. With Word 2007, it should be possible to save the
template in *.dotx format to strip out the macro-related garbage, then open
that and resave it in *.dot format.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
B

brian

You can right click on the ribbon and select Customize Quick Access
Toolbar... then click on Popular and select Show Developer tab in the Ribbon
then click OK

Click Developer then click Macros

This will display any macros currently associated with the open document

If you want everyone to not be bothered with macros you can click the Office
Button; select Word Options; go to Trust Center; click Trust Center Settings;
select Disable all macros without notification
 
P

Pamelia Caswell via OfficeKB.com

First, let me say that if you know very little about macros, you may know
too little to decide whether a macro is wanted or needed. So please be
careful. Anyway ...

In W2007, any document with the docx extension cannot contain macros.
Those with the docm extension can contain macros. For a .doc document, you
can try to save it as a .dotx. If Word allows a save as .dotx, the file
contains no macros.

You could also look in the macros dialog. Press Alt+F8 (the F8 function key)
to open the dialog. Click the arrow to the right of the input box after
"Macros in:". And from the drop-down list click the name of the document
(or template) you are in. If the list macros box is empty, there are no
macros in the document.

Note, though, that macros in an attached document template and any add-on
templates that are not in **trusted locations**, can trigger the message your
users are seeing.

Pam

You may be right, but that doesn't answer my question of how to find out
whether a document has an unwanted macro in it.

Does anybody out there know how to tell whether there's a macro in a
document or know where to find it?
Your users should not be opening the templates. Rather, they should be
using File>New and then selecting the appropriate template as the basis for
[quoted text clipped - 25 lines]
 

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