[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Opening PDF File in VB6

Posted on 2013-05-23
3
Medium Priority
?
656 Views
Last Modified: 2013-05-23
I have small application where i have store .pdf file name in database.
when i click any .pdf file name which are stored in directory name with out spaces it is working fine.
when .pdf file is in sub-directory with spaces and file name with spaces it is not working.

following is code in vb6
    Open "D:\ReadPDF.Bat" For Output As #1
        Print #1, "D:\Test.pdf"
    Close #1
    Shell "D:\ReadPDF.Bat", vbHide

above code working fine.


    Open "D:\ReadPDF.Bat" For Output As #1
        Print #1, "D:\test data\test try\Test test.pdf"
    Close #1
    Shell "D:\ReadPDF.Bat", vbHide


when any file name contains spaces it is not working

Thanks in advance
0
Comment
Question by:nitin_s_shah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
Guru Ji earned 1000 total points
ID: 39191341
Try wrapping the filename with the spaces in quotes like below

Print #l, """D:\test data\test try" & "\Test test.pdf"""

Open in new window


OR

Print #l, """" & "D:\test data\test try" & "\Test test.pdf" & """"

Open in new window

0
 
LVL 5

Assisted Solution

by:advfinance
advfinance earned 1000 total points
ID: 39191444
You need to add double quotes at the start and end
e.g.
shell """c:\test path\test file.pdf"""
0
 

Author Closing Comment

by:nitin_s_shah
ID: 39191588
Thanks both the experts for kind and prompt help

Once again Thanks

Nitin Shah
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question