WD97: Can't View Embedded Control Event Code
ID: Q167386
|
The information in this article applies to:
-
Microsoft Word 97 for Windows
SYMPTOMS
When you enter design mode to view the code for a control in a new
document based on a template that contains the embedded control (for
example a Command button), the Visual Basic for Applications code
appears to be missing.
CAUSE
In Word 97, documents and templates have their own Visual Basic for
Applications projects: a document project and a template project.
When you create a new document based on a template that contains a
control, you create a new "document" project. Because the control has
been embedded in the template, the code you create for the control
event resides within the template project. When you attempt to view
the code for a control after you create a new document based on a
template, you will only see the procedures for the document project.
Since the code for the control is stored in the template project, you
do not see the Visual Basic for Applications control code as expected.
WORKAROUND
To view the code for the control, use the following steps:
- On the View menu, point to Toolbars, and then click Control
Toolbox.
- Click the Design Mode button on the Control Toolbox toolbar.
- Select the control.
- Click the View Code button on the Control Toolbox toolbar.
- Switch to the Visual Basic Editor.
- On the View menu, click Project Explorer.
- In the Project Explorer, open the template project.
- Open the Microsoft Word Objects\ThisDocument module within the
template project.
- Select the ThisDocument module.
- On the View menu, click Code.
You can now see the code for the embedded control.
Additional query words:
wordcon 8.0 vb vbe vba lost invisible see
Keywords : kbprg kbusage kbwordvba
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbhowto