Wednesday, February 14, 2007

Hide Office document Design mode

When you open a Ms Office Excel, Word document that has embedded controls (combo box, check box and etc) , it always shows the Design toolbar. This is very annoying.

I have 'googled' for answer and no working solution found. I decided to attempt it myself and it works. However, it requires macro execution coz i did it using VBA.

I have tried VBA ActiveDocument.ToggleFormsDesign . Doesn't work.

Solution:
- Open the office document.
- Open the VBA Editor (Alt-F11).
- Add the following to the document_open events. Double click ThisDocument (under Microsoft Word Object).


Private Sub Document_Open()
CommandBars("Control Toolbox").Visible = False
CommandBars("Exit Design Mode").Visible = False
End Sub
- Exit VBA Editor.
- Save the document.
- Voila. Done.

No comments: