Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get current instance of Visual Basic
Message
From
09/03/2001 04:36:43
 
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
How to get current instance of Visual Basic
Miscellaneous
Thread ID:
00483440
Message ID:
00483440
Views:
48
How to get current instance of Visual Basic

How to set variable named "vbi", which is a variable to reference the current instance of Visual Basic.
Variable vbi used in samples : Manipulating Projects with Add-Ins (MSDN Library Visual studio 6).The following code fragments demonstrate how to reference the VBProject object and VBProjects collection, as well as other extensibility objects:

' Create new project.
Private Sub cmdCreateNew_Click()
Dim p As VBProject
Set p = vbi.VBProjects.Add _
(cmbProjKind.ItemData(cmbProjKind.ListIndex))
If txtProjName.Text <> "" Then
p.Name = txtProjName.Text
End If
End Sub

' Activate component.
Private Sub cmdActivate_Click()
Dim sc As String
Dim sp As String
Dim c As VBComponent

sp = cmbProj.Text
sc = cmbComp.Text
If sp <> "" And sc <> "" Then
Set c = _
vbi.VBProjects.Item(sp).VBComponents.Item(sc)
c.Activate
End If
End Sub

' Create new component of the type indicated in the
' cmbCompKind combo.
Private Sub cmdCreateNewVBComponent_Click()
Dim p As VBProject
Dim c As VBComponent
Dim sp As String
sp = cmbProj.Text
If sp <> "" Then
Set p = vbi.VBProjects.Item(sp)
Set c = p.VBComponents.Add _
(cmbCompKind.ItemData(cmbCompKind.ListIndex))
End If
End Sub

Thanks,
Dusan Grujic
e-mail: ozisabac@ptt.yu
Reply
Map
View

Click here to load this message in the networking platform