rbowes1
04-25-2007, 08:47 AM
This is one of my first programs, but I have done a lot of research on this and cannot find a way to accomplish it. I think that I have to use resources and possibly a wrapper, but have only been able to find examples that use bmps, wave files, icons, and Access databases… Initially I was hoping to use something as easy as:
objSession = objADRoot.OpenFile(My.Resources.Channel.AD_PRT) but found out that this is not possible.
What I have are three separate files in the Resources and I want to open them up from within my program so the end user does not have to manually copy them to their hard drive. Right now the user has to copy these files to C:\ (hard-coded in the program) so it will know where to open them up from. If the files are not in the root location of C:\ then the program tells the user to put the files there and rerun the program.
'Current working code
'Open the file if it exists
If File.Exists("C:\Channel.AD_PRT") Then
objSession = objADRoot.OpenFile("C:\Channel.AD_PRT")
Else
MsgBox("Please put the Channel.AD_PRT in C:\ and restart this program")
End
End If
What I want is to have my program open the needed file from the resource. I have tried similar examples from http://www.thescripts.com/forum/thread549616.html but have been unable to get them working with my code.
If this route is not possible, or if there is another way or method then I would be willing to try it.
- Ron
objSession = objADRoot.OpenFile(My.Resources.Channel.AD_PRT) but found out that this is not possible.
What I have are three separate files in the Resources and I want to open them up from within my program so the end user does not have to manually copy them to their hard drive. Right now the user has to copy these files to C:\ (hard-coded in the program) so it will know where to open them up from. If the files are not in the root location of C:\ then the program tells the user to put the files there and rerun the program.
'Current working code
'Open the file if it exists
If File.Exists("C:\Channel.AD_PRT") Then
objSession = objADRoot.OpenFile("C:\Channel.AD_PRT")
Else
MsgBox("Please put the Channel.AD_PRT in C:\ and restart this program")
End
End If
What I want is to have my program open the needed file from the resource. I have tried similar examples from http://www.thescripts.com/forum/thread549616.html but have been unable to get them working with my code.
If this route is not possible, or if there is another way or method then I would be willing to try it.
- Ron