I have had a look but from what I can see none of the posts really explain how to open a file name stored within a variable as I have more than one file and shell requires a pathname I cannot use it can someone walk me through it please
here plinkster take a look at this i just made it i tried to explain as i went thru the code... tell me if you have any questions look at my attachment! (made it just for you)
if you want you could do one that detects if its a txt file or picture but i dont feel like doing all that coding.. look at my example and you will understand how it works i used common dialog to open and save good luck
You are using the common dialog for a user to select from. That dialog does return the full path & file name of the selected file(s). If the example posted in previous reply isn't what you are looking for, I think it is time to provide a bit more information and/or code that you are now using.
Edited: Oh, and the 1st two times you set the .Flags member, are obsolete since the last one is the only one that is saved. Try this instead:
.Flags = cdlOFNHideReadOnly Or cdlOFNFileMustExist
cdlOFNOverwritePrompt is only appropriate if calling ShowSave, not ShowOpen
Last edited by LaVolpe; Nov 25th, 2011 at 02:15 AM.
Insomnia is just a byproduct of, "It can't be done"
Thanks guys you have been a lot of help sorry for my late reply I've been rather busy. Max187 thanks again for going to this amount of effort, I've had a look and it does answer a lot of questions however the file is opened in Vb is there a way to open it in word for example?
Thanks again I appreciate it
Shell Chr(34) & "C:\Windows\system32\notepad.exe" & Chr(34) & " " & Chr(34) & StringFileName & Chr(34), vbMaximizedFocus
'"C:\Windows\system32\notepad.exe" instead of this put your word.exe location "C:\Windows\system32\word.exe" (i dont know if thats the right location just a guess)
'and at strfilename put you "C:\FoldersNamehere\Filenamehere.txt" so it would look like this
'Shell Chr(34) & "C:\Windows\system32\word.exe" & Chr(34) & " " & Chr(34) & "C:\FoldersNamehere\Filenamehere.txt" & Chr(34), vbMaximizedFocus
i will give you this project of mine still got things to adjust and add but try this its a drag n drop file that opens file with certain program... you can change or add programs tell me what you think
The program is looking nice still some rough edges but I think thats mostly because my Visual basic is screwing up by not loading some of the files that you have uploaded. However have you thought about implementing another way of opening your files as well as in windows live gallery?
I have one more question however is there any method of enabling the file selected with a common dialog box to be opened with its default program because as of now I have to specify the actual program that I wish to open it with which kind of defeats the purpose of the dialog box, Thanks again you've been a great help.