Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 31st, 2003, 10:39 AM
Afshin Afshin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 Afshin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question How to open a pdf file in vb?

How can you open a pdf file from inside vb?

What I need to do is supply the file name and have vb find the file (which I've done) and then open it using Acrobat Reader. I know I can launch the acroread using the shell command, but I don't believe that the windows version of acroread accepts command line arguments to open a file.

Any suggestions would be appreciated.

NEVER MIND. Apparently it does take command line argument for file input, so I just used the shell command to launch acroread with the file name to open.

Last edited by Afshin : July 31st, 2003 at 10:52 AM.

Reply With Quote
  #2  
Old February 25th, 2004, 09:57 AM
rajiv rajiv is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: india
Posts: 3 rajiv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to rajiv
Lightbulb re-open a file from vb

i hope you know the shell command

there is a dos command - start.exe , type start /? on command prompt and see the details

go to the directory where the pdf file is, let us say C:\pdf\mypdf.pdf, in the dos prompt

execute this command
start C:\pdf\mypdf.pdf

it will open the file, with its associated application, in our case acrobat reader

by this, you can open any type of file in there default application - mp3,wav,etc etc

so in vb, you can run the command from shell, that is -

shell ("start " + myFileNameWithPath,,,,,)

rajiv

Reply With Quote
  #3  
Old February 25th, 2004, 10:28 AM
edburdo edburdo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 50 edburdo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Or you can use the ShellExecute API. It opens a document in whatever program is associated with it.

Reply With Quote
  #4  
Old June 7th, 2004, 07:50 AM
Code Monkey 77 Code Monkey 77 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 6 Code Monkey 77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 43 m 2 sec
Reputation Power: 0
I'm attempting to print a pdf file from within VB.

Can anyone tell me how to close the pdf application down once I've printed the document out?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How to open a pdf file in vb?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT