Jean-Guy
Fri Jul 29 22:43:53 CDT 2005
Mirka was telling us:
Mirka nous racontait que :
> 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.
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
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site:
http://www.word.mvps.org