reference name (1 Viewer)

wazz

Super Moderator
Local time
Tomorrow, 02:11
Joined
Jun 29, 2004
Messages
1,711
is there a way to get the name of a reference the way it appears in the 'available references' window? ex, 'Microsoft Word 11.0 Object Library', instead of 'Word' from References.Name.
 
Last edited:

wazz

Super Moderator
Local time
Tomorrow, 02:11
Joined
Jun 29, 2004
Messages
1,711
hi chergh.
there's no description property. how would i use that?
i tried ?application.References(6).description but got an error in immediate window (method or data member not found).
 

chergh

blah
Local time
Today, 19:11
Joined
Jun 15, 2004
Messages
1,414
The references collection of the application object would appear to have different properties than that of the vbproject object. I was returing the description as follows:

Code:
? application.vbe.vbprojects("ProjName").references(6).description
 

Endre

Registered User.
Local time
Today, 20:11
Joined
Jul 16, 2009
Messages
137
Some News:

Access.Application.References(n).FullPath will give you the exact file name.

You can now use CreateObject("Scripting.FileSystemObject").GetFile(Access.Application.References(n).FullPath ) to obtain the file as an object and explore it's attributes.

The not so good news::mad:
However, I think this is as far as you can get with VBA. You will need the dsofile.dll to take it much further, but it won't work as a reference in VBA.

You can go much further with VB and .NET with the dsofile.dll (http://support.microsoft.com/?kbid=224351)
And also: http://www.dotnet247.com/247reference/msgs/41/205059.aspx

(These are references from a post I made a few years ago: http://test.vbcity.com/forums/p/85231/353755.aspx#353755)
 

Endre

Registered User.
Local time
Today, 20:11
Joined
Jul 16, 2009
Messages
137
My apologies - you are quite correct, referencing the object from the application seems to allow the exploration of different properties:

Application.VBE.vbprojects(1).References(2).Description

It seems we have access to 3 more properties referencing this way: Description, Type, VBE. Strange, BUT, works just great for your answer. So ignore my previous (but maybe interesting?) post.
 

wazz

Super Moderator
Local time
Tomorrow, 02:11
Joined
Jun 29, 2004
Messages
1,711
Code:
? application.vbe.vbprojects("ProjName").references(6).description
thanks very much. i was looking at currentproject and codeproject. completely forgot about vbe.

Code:
? application.vbe.vbprojects.Count
 1 
? application.vbe.VBProjects(1).Name
Access9db
 
? application.vbe.vbprojects(1).references(n).Description
or
? application.vbe.vbprojects("Access9db").references(n).Description
it works.
thanks again.
 

wazz

Super Moderator
Local time
Tomorrow, 02:11
Joined
Jun 29, 2004
Messages
1,711
hi endre,
didn't see your prev post. i see you've found it too. nice.
w
 

Users who are viewing this thread

Top Bottom