MS VISUAL BASIC FOR APPLICATIONS EXTENSIBILITY

USUARIO.EXCLUIDOS 28/11/2006 22:31:43
#186856
Alguém tem uma boa apostila [S92] sobre


Microsoft Visual Basic for Applications Extensibility
e/ou
Microsoft Visual Basic for Applicatications

Ah... Uma boa síntese já ajuda:

Quando assinalo essas duas "References" numa aplicação, quais as funções que elas acrescentam?
E COMO acioná-las?
Algum exemplo?

Qualquer [S50] será bem vinda.

Obrigado.[s67]
USUARIO.EXCLUIDOS 29/11/2006 14:53:03
#186990
Citação:

HUGOSSOUZA escreveu:
Working with the Microsoft Visual Basic for Applications Extensibility Library



O conteúdo do link é este:

Working with the Microsoft Visual Basic for Applications Extensibility Library

The Microsoft® Visual Basic® for Applications (VBA) extensibility library provides objects that you can use to work with the Visual Basic Editor and any VBA projects that it contains. From an add-in created in Visual Basic 6.0, you can return a reference to the VBE object, the top-level object in the VBA Extensibility library, through the Application argument of the OnConnection event procedure. This argument provides a reference to the instance of the Visual Basic Editor in which the add-in is running.

The VBProject object refers to a VBA project that is open in the Visual Basic Editor. A VBProject object has a VBComponents collection, which in turn contains VBComponent objects. A VBComponent object represents a component in the project, such as a standard module, class module, or form. Because a VBComponent object can represent any of these objects, you can use its Type property to determine which type of module you are currently working with.

For example, suppose you have a variable named vbeCurrent, of type VBIDE.VBE, which represents the instance of the Visual Basic Editor in which the add-in will run. The following code fragment prints the names and types of all components in the active project to the Immediate window:

Dim vbcComp As VBIDE.VBComponent
For Each vbcComp In vbeCurrent.ActiveVBProject.VBComponents Debug.Print vbcComp.Name, vbcComp.Type
Next vbcComp

A VBComponent object has a CodeModule property that returns a CodeModule object, which refers to the code module associated with that component. You can use the methods and properties of the CodeModule object to manipulate the code in that module on a line-by-line basis. For example, you can insert lines by using the InsertLines method, or perform find and replace operations by using the Find and Replace methods.

To work with command bars in the Visual Basic Editor, use the CommandBars property of the VBE object to return a reference to the CommandBars collection.

For more information about working with the VBA Extensibility library, search the Visual Basic Reference Help index for "VBProject object."


Tá bom que eu pedi síntese... mas da pra abrir um pouco mais?

Obrigado.
Tópico encerrado , respostas não são mais permitidas