View Poll Results: Was this helpful?
- Voters
- 0. You may not vote on this poll
-
Trouble using CALL SHELL()
I found and pasted the code called "Alternative to VB's Shell Function" into my application from this site. The SHELL command will not open a PDF file! Is Adobe doing something strange to their files that will not allow them to open? I am getting the path and file name from the Common Dialog Control. The weird thing is, I can right click the file in the CDC and choose "open with Acrobat..." and the file opens. If I left click the file and choose OPEN, I get nothing. If I pass the PATH to your SHELL command, I get nothing. If I pass "...system32\calc.exe" to your SHELL command I get the Windows Calculator, no problem. Any ideas?
-
can you post the url where you found the code?
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
-
this works fine with me:
Private 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
Private Const SW_SHOW = 5
ShellExecute 0, "open", "C:\MyFolder\MyPDFFile.pdf", vbNullString, vbNullString, SW_SHOW
check that: 1) you are passing the full path name and that 2) the .pdf files have Acrobar Reader as the default application. For the second point, try to double click on a pdf file as see if it opens ok. If not, select Acrobat Reader from the list of applications and select it as the default.
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
Thanks!!!
That worked great and I thank you very much.
Similar Threads
-
Replies: 3
Last Post: 07-31-2005, 05:17 PM
-
By anshulsarabhai in forum Database
Replies: 1
Last Post: 07-08-2005, 02:08 PM
-
By none_none in forum C++
Replies: 13
Last Post: 04-19-2005, 05:20 PM
-
By Mike in forum VB Classic
Replies: 2
Last Post: 04-24-2000, 03:30 PM
-
By Mike in forum VB Classic
Replies: 0
Last Post: 04-24-2000, 03:05 PM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks