Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
programming4us
Windows 7

Microsoft Word 2010 : Expanding Word Functionality - Setting ActiveX Control Properties & Adding VBA Code to an ActiveX Control

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
9/8/2011 4:46:23 PM

Setting ActiveX Control Properties

Every ActiveX control has properties, or settings, that determine its appearance and function. You can open a property sheet that displays all the settings for that control in alphabetic or category order directly from Word. The ActiveX controls appear in the Properties window in two columns: the left column displays the name of the control, and the right column displays the current value or setting for the control. When you select either column, a list arrow appears in the right column, allowing you to select the setting you want. After you set properties, you can add VBA code to a module to make it perform.

Set ActiveX Control Properties

Click the Developer tab.

Click the Design Mode button (highlighted).

Select the control whose properties you want to modify.

Click the Properties button.

To switch controls, click the Controls list arrow (at the top), and then select the one you want.

Click the Alphabetic or Categorized tab to display the control properties so you can find the ones you want.

Click the property box for the property you want to modify, and then do one of the following:

  • Type the value or information you want to use, such as the control name.

  • If the property box contains a list arrow, click the arrow and then click a value in the list.

  • If a property box contains a dialog button (...), click it to open a dialog box to select options or insert an object, such as a picture.

When you’re done, click the Close button on the Properties window.

Click the Design Mode button (not highlighted) to exit.

Adding VBA Code to an ActiveX Control

After you add controls and set properties, you can add VBA code to a module to determine how the controls respond to user actions. All controls have a predefined set of events. For example, a command button has a Click event that occurs when the user clicks the button. When you select a control in Design Mode and then click the View Code button, the Visual Basic Editor opens with a Code window, displaying the start of a procedure that runs when the event occurs. The top of the Code window displays the active object and event procedure. The Object list displays the ActiveX control, such as CommandButton1, and the Procedure list displays the trigger event, such as Click.

Add VBA Code to an ActiveX Control

Click the Developer tab.

Click the Design Mode button (highlighted).

Select the control to which you want to add VBA code.

Right-click the control, and then click View Code.

The Visual Basic Editor window opens.

To show the Properties window, click the Properties window button.

To help with scripting commands, click the Object Browser button on the toolbar.

Click in the Code window between the beginning and ending line of the procedure, and then type VBA code to perform the task you want.

The Object list is set to CommandButton1, and the Procedure list is set to Click.

When you’re done, click the Save button on the toolbar.

Click the program Close button.

Click the Design Mode button (not highlighted) to exit.

Other -----------------
- Microsoft Word 2010 : Expanding Word Functionality - Inserting ActiveX Controls
- Microsoft PowerPoint 2010 : Setting Add-in Security Options & Setting ActiveX Security Options
- Microsoft PowerPoint 2010 : Selecting Trusted Publishers and Locations & Setting Document Related Security Options
- Microsoft Visio 2010 : Linking to a Specific Location in a Document
- Microsoft Visio 2010 : Linking to a Website & Linking to a Document
- Microsoft Excel 2010 : Removing Table Rows and Columns & Entering Data in a Table Using a Drop-Down List
- Microsoft Excel 2010 : Creating Calculations in a Table & Working with Tables
- Microsoft Word 2010 : Using Content Controls to Create Documents
- Microsoft Word 2010 : Saving a Document with Macros & Opening a Document with Macros
- Visual Basic 2010 : Advanced Compilations with MSBuild - Introducing MSBuild (part 2) - Understanding Tasks and Creating Targets
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server