InsertObject Macro blocking access to other Insert Menu Items

L

Lenny

I created the simple macro below for a protected form template that is
executing in a non-protected section of the form template. The bounding box
dimensions have been entered into the macro so the user has a good size
working area to begin.

The macro is stored on a toolbar with other customizations.

When the user wants to use INSERT with some some function, other than
"Microsoft Word Picture", like Equation Editor, the macro executes and high
jacks them into the Word Picture Editor. Is this normal? They are not
clicking on the button to execute the macro in the toolbar.... is there a way
to modify the code in the macro to get the user to the dropdown list so they
can scroll down and make their selection?

See code below..... Lenny


Sub InsertObject()
'
' InsertObject Macro
' Macro recorded 5/14/2008
'
Selection.InlineShapes.AddOLEObject ClassType:="Word.Picture.8",
FileName _
:="", LinkToFile:=False, DisplayAsIcon:=False
Selection.PageSetup.LeftMargin = 84
Selection.PageSetup.RightMargin = 462
Selection.PageSetup.BottomMargin = 330
End Sub
 
L

Lene Fredborg

As I understand your description, you want users to be able to use both your
macro and the built-in Insert > Object command. You can easily make this
happen.

The problem occurs because you have named your macro InsertObject. That is
the exact name of the command run by Word when selecting Insert > Object. If
Word finds a macro with the same name as a built-in command, that macro runs
instead of the built-in command. That is sometimes what you really want but
in your situation, rename your macro to something else (also remember to
reassign the macro to your toolbar with the new name). Your macro will then
no longer conflict with the built-in command.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
L

Lenny

Lene: my thanks and boy - what an oversight. I could not see the forrest
for the trees! Lenny
 

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