Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 944
  • Last Modified:

Folder Item , ShellFolderView

I am not a VB expert and I just can't get this thing to work.
In html you can use :
<input type="file">

all I'm trying to do is this exact thing.

My code so far for this part is :

Private Sub b_browse_Click()
Dim browseForFiles As New ShellFolderView
Dim pfi As FolderItem
Dim fileReturnName As String
fileReturnName = browseForFiles.PopupItemMenu(pfi)
End Sub


the popupItemMenu returns an error , and I just can't understand why.
My idea is that I need to do something with the pfi (set a folder) but I can't understand how.

0
avner
Asked:
avner
  • 6
  • 2
  • 2
  • +1
1 Solution
 
wgilsterCommented:
Which tlbs or dlls are you referencing to give you the ShellFolderView object?
0
 
avnerAuthor Commented:
I just found the answer.

Instead of using :

Dim browseForFiles As New ShellFolderView

I'm using :
Dim myShell As New Shell
Dim FoldItem As FolderItem
Dim l1 As Long
Dim l2 As Long
Set FoldItem = myShell.BrowseForFolder(l1, "Select Folder", l2)



And it works..

I'll leave the question open because I know I'll have a different question in a few momments.
0
 
avnerAuthor Commented:
As I thought it dosen't work.

the code is :
Dim myShell As New Shell
Dim FoldItem As FolderItem
Dim l1 As Long
Dim l2 As Long
FoldItem = myShell.BrowseForFolder(l1, "Select Folder", l2)


It opens the GUI as I want , but when I close it (and the return thing get to work) I get an Error.

I have a reference to "Microtosft Shell control and automation"
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Richie_SimonettiIT OperationsCommented:
Try:
set FoldItem = myShell.BrowseForFolder(l1, "Select Folder", l2)


0
 
avnerAuthor Commented:
Solved the problem .

Thanks.
0
 
Valliappan ANSenior Tech ConsultantCommented:
In that case, you could delete this one, and post another, with the relevant title, so that more experts, could help you.

Cheers.
0
 
Valliappan ANSenior Tech ConsultantCommented:
sorry, just its all the posting/accepting delay/speed issues. ignore the message.
0
 
avnerAuthor Commented:
The complexity of deleting a question , creating a new one and then accepting an answer dosen't worth it.

My opinion.
0
 
avnerAuthor Commented:
I'll ignore it now :)
0
 
Richie_SimonettiIT OperationsCommented:
I'm going crazy!
Avner, are you editing this question along way?
0
 
avnerAuthor Commented:
I Swear god I didn't !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 6
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now