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

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 video Game
-   Minecraft Mods - MAD PACK #10 'NETHER DOOM!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #9 'KING SLIME!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #2 'LAVA LOBBERS!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #3 'OBSIDIAN LONGSWORD!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Total War: Warhammer [PC] Demigryph Trailer
-   Minecraft | MINIONS MOVIE MOD! (Despicable Me, Minions Movie)
-   Minecraft | Crazy Craft 3.0 - Ep 3! "TITANS ATTACK"
-   Minecraft | Crazy Craft 3.0 - Ep 2! "THIEVING FROM THE CRAZIES"
-   Minecraft | MORPH HIDE AND SEEK - Minions Despicable Me Mod
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 92 "IS JOE DEAD?!"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 93 "JEDI STRIKE BACK"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 94 "TATOOINE PLANET DESTRUCTION"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 95 "TATOOINE CAPTIVES"
-   Hitman [PS4/XOne/PC] Alpha Gameplay Trailer
-   Satellite Reign [PC] Release Date Trailer
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
PS4 game trailer XBox One game trailer
WiiU game trailer 3ds game trailer
Trailer game
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer