|
-
Sep 27th, 2000, 09:23 AM
#1
Thread Starter
Addicted Member
It seems that, in effect, there isn¡¯t much difference between the Shell and ShellExecute functions. I have tried both of them and still the problem I proposed in my ¡°call an outside application¡± topic remains. HeSaidJoe has suggested a resolution, but I am stupid enough not to be able to solve it, for I must open a document file in that directory (with a space in it).
-
Sep 27th, 2000, 09:28 AM
#2
_______
<?>
application¡± topic 'what is it with your fonts....
that stuff is hard to read when it keeps popping in
and out.
Post your code so I can get a better idea of how to deal with the situtation.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 27th, 2000, 09:30 AM
#3
Lively Member
Dosen't somthing like this work ????
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
ShellExecute hwnd, "Open", "C:\my documents\my stuff.doc", "", "c:\my documents", 9
-
Sep 27th, 2000, 09:36 AM
#4
_______
<?>
This works with spaces in the folder name and
with spaces in the file name.
Code:
'put this in a bas module
'
Public Declare Function ShellEx Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As Any, _
ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
'
'Form events
'open a file with it's associated application
Private Sub Command1_Click()
'
Dim sFileName As String, x As Long
sFileName = "c:\my documents\my special file.txt"
x = ShellEx(Me.hwnd, "open", sFileName, "", "", 1)
'=====================================
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 27th, 2000, 11:20 AM
#5
Thread Starter
Addicted Member
I have succeeded. Thank you, HeSaidJoe and joefoulkes.
-
Sep 29th, 2000, 10:29 AM
#6
Thread Starter
Addicted Member
And then there were still problems, which came up with document files having an association different from the default one. For example, on one of my computers ACDSee is installed which is associated with the .BMP files whose default server should have been MSPaint.exe or Pbrush.exe. When I used the ShellExecute function to open a .BMP file, it called up ACDSee with which I could not edit the file. I finally solved the problem with the following code:
strWinDir = ¡°C:\Windows¡±
strBmpFile = ¡°C:\Program Files\Microsoft Exchange\Image.bmp¡±
Shell strWinDir & ¡°\Pbrush.exe ¡° & Chr$(34) & strBmpFile & Chr$(34), vbMaximizedFocus
Thank you all the same, HeSaidJoe and joefoulkes.
-- IHailJoe
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
|