Persistent toolbar .... how irritating

G

gvm

This seems so trivial but it isn't to me. I have a Word doc which when
opened, shows the 'Control Toolbox' toolbar as well as a small dialog box
that allows me to exit 'Design Mode'. I don't want these items to appear so I
close the latter and I turn the former off at View/toolbars/Control. I then
save the document.

When I then re-open the doc, the same two items re-appear. Why? It doesn't
happen with other documents.
TIA ... Greg
 
J

Jay Freedman

This seems so trivial but it isn't to me. I have a Word doc which when
opened, shows the 'Control Toolbox' toolbar as well as a small dialog box
that allows me to exit 'Design Mode'. I don't want these items to appear so I
close the latter and I turn the former off at View/toolbars/Control. I then
save the document.

When I then re-open the doc, the same two items re-appear. Why? It doesn't
happen with other documents.
TIA ... Greg

That happens when you use any control from the Controls Toolbox and you have
your macro security level set to High or Very High, which disables macros and
the ActiveX controls from the toolbox. And when the controls are disabled, the
document automatically switches to design mode.

You can (a) set the level (Tools > Macro > Security) to Medium and click the
Enable button every time you open the document; or (b) remove all Control
Toolbox objects from the document and replace them with form fields (which
unfortunately require "protect document for forms" and have their own set of
drawbacks).
 
G

gvm

Thanks Jay. How do I locate the control toolbox objects please? None are
required so if some found there way into the document inadvertently I would
like to find them and delete them,
TIA ... Greg
 
J

Jean-Guy Marcil

gvm said:
Thanks Jay. How do I locate the control toolbox objects please? None are
required so if some found there way into the document inadvertently I would
like to find them and delete them,
TIA ... Greg

Look for check boxes, dropdown lists, text boxes or list boxes, etc. They
are the objects you can insert from the toolbar that appears and that you do
not want... While in desiign mode, select them and hit delete on the keyboard.
 
G

gvm

Jean-Guy, there are not any of the objects you mention apparent in the
document. Maybe there is one there that was put there by accident and is not
apparent because it is not functional. Is there any way of selecting control
toolbox objects? TIA .... Greg
 
J

Jean-Guy Marcil

gvm said:
Jean-Guy, there are not any of the objects you mention apparent in the
document. Maybe there is one there that was put there by accident and is not
apparent because it is not functional. Is there any way of selecting control
toolbox objects? TIA .... Greg

:

They could be hidden, off the page, or behind other objects...

Run the following code to spot each one:

Sub test()

Dim inShpActiveX As InlineShape
Dim shpActiveX As Shape

For Each shpActiveX In ActiveDocument.Shapes
If shpActiveX.Type = msoOLEControlObject Then
MsgBox shpActiveX.OLEFormat.Object.Name
shpActiveX.Select
ActiveDocument.ToggleFormsDesign
Exit Sub
End If
Next

For Each inShpActiveX In ActiveDocument.InlineShapes
If inShpActiveX.Type = wdInlineShapeOLEControlObject Then
MsgBox inShpActiveX.OLEFormat.Object.Name
inShpActiveX.Select
ActiveDocument.ToggleFormsDesign
Exit Sub
End If
Next

End Sub

Hit delete on the keyboard once you have spotted them.

Or, if you do not care to see where and what they are, run this instead:

Sub test()

Dim inShpActiveX As InlineShape
Dim shpActiveX As Shape

For Each shpActiveX In ActiveDocument.Shapes
If shpActiveX.Type = msoOLEControlObject Then
shpActiveX.Delete
End If
Next

For Each inShpActiveX In ActiveDocument.InlineShapes
If inShpActiveX.Type = wdInlineShapeOLEControlObject Then
inShpActiveX.Delete
End If
Next

End Sub

I must use two "For...Next" blocks because ActiveX controls, like almost any
object on the page, can be inline or floating, which are two totally
different critters...

If you still experience problems, look in the VBA editor for any userforms
associated with the document.

If you need help with the macros, see
http://word.mvps.org/faqs/macrosvba/CreateAMacro.htm
 

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