Macros security message on code pasted into editor.

H

Henslow

When I migrated to Word 2003, I brought most of my Word 97 macros with me. I
just remembered one I had forgotten, and opened the old application, copied
the code, and pasted all the code for the macro it into the Word 2003 VBA
editor (macros for Normal.dot). When I tried to run the macro, it said that
my security settings wouldn't allow the macro to work.

How do the security settings distinguish between pasted code from somewhere
else and a macro that is recorded in Word and then edited? I don't understand
what I did that caused a security issue.
 
J

Jay Freedman

Normally, pasting in macro code is not a security issue. There is one
area, though...

Does the newly pasted code use the VBE object and its child objects to
manipulate macro code? If so, you need to go to the macro security
dialog, click the Trusted Publishers tab, and check the box for "Trust
access to Visual Basic Project".

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

Ryan

Any way to check that box programatically?

Jay Freedman said:
Normally, pasting in macro code is not a security issue. There is one
area, though...

Does the newly pasted code use the VBE object and its child objects to
manipulate macro code? If so, you need to go to the macro security
dialog, click the Trusted Publishers tab, and check the box for "Trust
access to Visual Basic Project".

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

Jay Freedman

No, and for a very good reason: You wouldn't want a macro virus to be able
to get access to your VBA environment, to be able to write whatever code it
wants there. It would be a huge security hole.

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

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