473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Getting full name of file selected in Solution Explorer from Add-in

In an add-in I'm doing, I need to get the full filename of the file(s)
selected by the Visual Studio 2005 user at a given time.

Using:

Dim win As Window = _applicationObject.ActiveWindow

Dim uih As UIHierarchy = Nothing

Dim uihItem As UIHierarchyItem = Nothing

If Not win Is Nothing Then

If win Is
_applicationObject.Windows.Item(Constants.vsWindow KindSolutionExplorer) Then

uih = CType(win.Object, UIHierarchy)

For Each uihItem In uih.SelectedItems

Dim itemName = uihItem.Name.ToString

Next uihItem

End If

End If

I can get the filename of the selected item, but I only get the filename,
not the full path, and there is no other properties on UIHierarchyItem that
seem to be of any help. Of course, I could recursively iterate the whole
solution tree looking fo the filename(s) found, but what if there is more
than one Form1.vb in the solution (in different projects of course)? Then I
wouldn't know which of them is the chosen item in the Solution Explorer
anyway.

UIHierarchyItem does have an "Object" property, but it doesn't look like I
can cast it to anything that can help my quest...

Cheers,

Johnny J.
Aug 23 '07 #1
0 1577

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Hareth | last post by:
How can I read lines from an XML file. & add them to a counter. If possible, words between <page> <\page> is considered as +1 to my counter. if it isnt possible, I would atlest like to read...
1
by: Andres Romero | last post by:
Using the FielDialog class and it's FileName propertie I can know the Path and file name selected by the user, but now I need to know only the file name without the full path (eg....
0
by: José Joye | last post by:
Hello, Is there a way within VS2005 to synchronize the Solution Explorer view and the file we are currently working on. Say I'm working on blabla.cs file which is located within the foo...
1
by: bagya | last post by:
please help me out the following is the small code i have <html> <head> <script type="text/javascript"> function validate() { if (document.abc.region.value==0)
1
by: marathoner | last post by:
When I use the FileUpLoadControl to select a file, I can only retrieve the filename that was selected. I want to know how to retrieve the full pathname of the filename selected. Marathoner
2
by: royend | last post by:
How may I include a .ascx-file into my C#-file? I have read somewhere that the usual include is no longer supported for ASP.NET C#, but is there someway around this? The file to be included is...
4
by: ravitunk | last post by:
hello...i have a fileupload control on my page and if i browse to a file(i.e.,now the fileupload control's property 'hasfile' is 'true') and then if i post back the page for any validations, the...
3
by: ArmageddonAsh | last post by:
I'm trying to make an application that will allow the user to enter data into a flexgrid (that's done) and then save the data from that flexgrid into a CSV file but even though the file is made none...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
9
by: Bill David | last post by:
I know it's very strange to do that since we have the file name when we call: int open(const char *pathname, int oflag,...); And we can store the file name for later usage. But I just wonder if...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.