|
-
Nov 18th, 2000, 09:55 AM
#1
Thread Starter
New Member
I am an novice VB user, and am a little stuck on a project I am working on. I am accessing the API to open files on a cd. What I would like to do, is access a different file depending on what the cd drive letter is. I use:
ShellExecute hwnd, "open", "D:\book2.pdf", vbNullString, CurDir$, SW_SHOW
but I would like to access a different file if the drive letter is, say, drive letter E:
any suggestions??
-
Nov 18th, 2000, 12:31 PM
#2
I think you can just leave it blank and it will open automatically no matter what drive it is.
ShellExecute hwnd, "open", "D:\book2.pdf", vbNullString, "", SW_SHOW
or
ShellExecute hwnd, "open", "D:\book2.pdf", vbNullString, vbNullString, SW_SHOW
-
Nov 19th, 2000, 07:28 PM
#3
Thread Starter
New Member
But what I really am looking for, is a different file opening for the different drive letter. So if the current cd drive is D:, then one file opens, but if it is Z:, then a different file opens.
???????
-
Nov 19th, 2000, 07:38 PM
#4
A few things: what happens when you leave it blank with a "" or vbNullString?
And second, is the user choosing the file? Because you can do something like:
Code:
StrFile$ = "D:\book2.pdf"
StrDir$ = Left(StrFile$, 3)
ShellExecute hwnd, "open", strFile$, vbNullString, strDir$, SW_SHOW
-
Nov 21st, 2000, 11:47 AM
#5
Thread Starter
New Member
This dosen't seem to solve my problem. To be more specific, I have files on a CD that are hyperlinked. I am using VB as a front end to the .pdf files that I have on that CD. If the CD drive is D: , I may want to:
ShellExecute hwnd, "open", "D:\bookD.pdf", vbNullString, CurDir$, SW_SHOW
but if the CD is Z: , then I may want it to point to:
ShellExecute hwnd, "open", "Z:\bookZ.pdf", vbNullString, CurDir$, SW_SHOW
that way I get the execution of the correct set of hyperlinked files.
I don't know if I'm making this more difficult than it needs to be, but I don't know how else to do it.
HELP!!??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|