Hi everyone!
Is there a way to tick or untick the references from the tools menu not
manually but with a command?
I found in VBA help a command like this:
VBE.ActiveVBProject.References.Count and tried to display in a msgbox the
references of my project but I got no result although I ckecked that when I
opened the references from the tools menu there where 5 references ticked.
Heike Pertzel - 29 Jul 2005 09:06 GMT
Hallo Mirka,
try it like this:
Dim xx As Object
On Error Resume Next
Set xx = Application.VBE.ActiveVBProject.References.Item("Shell32")
Application.VBE.ActiveVBProject.References.Remove xx
On Error GoTo 0
Application.VBE.ActiveVBProject.References.AddFromFile
("C:\windows\system32\shell32.dll")
Heike Pertzel / DATA 5 GmbH
> Hi everyone!
>
[quoted text clipped - 5 lines]
> I
> opened the references from the tools menu there where 5 references ticked.
Jean-Guy Marcil - 30 Jul 2005 04:43 GMT
Mirka was telling us:
Mirka nous racontait que :
> Hi everyone!
>
[quoted text clipped - 5 lines]
> that when I opened the references from the tools menu there where 5
> references ticked.
Try this to get them listed:
'_______________________________________
Dim i As Long
Dim myRef As String
With VBE.ActiveVBProject.References
For i = 1 To .Count
myRef = myRef & "Ref # " & i & " : " & .Item(i).Name & vbCrLf _
& " Description: " & .Item(i).Description & vbCrLf _
& " Location: " & .Item(i).FullPath & vbCrLf _
& " Registry key: " & .Item(i).GUID & vbCrLf
Next
MsgBox myRef
End With
'_______________________________________
And look up the following methods to programmatically add references:
.AddFromFile
.AddFromGuid

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org