4 Replies - 943 Views - Last Post: 28 November 2012 - 02:13 AM Rate Topic: -----

#1 suzwam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-November 12

im trying to view pdf files in vb6 by clicking a cmd button on a form

Posted 27 November 2012 - 11:56 PM

Private Sub Command1_Click()

Dim variable1 As String
Open "d:\A_01_Coltlancer92-96workshopmanual\BODY.pdf " For Input As #1
Input #1, variable1
Command1.Caption = variable1
Close #1

End Sub
Is This A Good Question/Topic? 0
  • +

Replies To: im trying to view pdf files in vb6 by clicking a cmd button on a form

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: im trying to view pdf files in vb6 by clicking a cmd button on a form

Posted 28 November 2012 - 01:44 AM

What you're actually trying to do there is read the contents of a PDF file into a string and then display that string on a command button.....is that really what you want to do, or do you want to be able to click the button, then the PDF opens in the default PDF reader program?

If it is the latter, then have a quick google on the SHELL function.

Otherwise, please clarify exactly what you're trying to achieve.
Was This Post Helpful? 0
  • +
  • -

#3 suzwam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-November 12

Re: im trying to view pdf files in vb6 by clicking a cmd button on a form

Posted 28 November 2012 - 01:50 AM

View Postmaj3091, on 28 November 2012 - 01:44 AM, said:

What you're actually trying to do there is read the contents of a PDF file into a string and then display that string on a command button.....is that really what you want to do, or do you want to be able to click the button, then the PDF opens in the default PDF reader program?

If it is the latter, then have a quick google on the SHELL function.

Otherwise, please clarify exactly what you're trying to achieve.


Hi, thnx for your answer. as u said im trying to be able to click the button and the pdf will open automatically and i can be be able to do this for as many pdf's as possible..im new in visual basic, forgive my shallowness..
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: im trying to view pdf files in vb6 by clicking a cmd button on a form

Posted 28 November 2012 - 02:03 AM

It's not a problem.....have a google on the SHELL function, or look in the forum here, it appears regularly.

If you're so new in VB6, I would be tempted to look at focusing your efforts on the newer VB.Net.

I'm not trying to put you off, but it makes sense to learn a newer language.

Good luck.
Was This Post Helpful? 0
  • +
  • -

#5 suzwam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-November 12

Re: im trying to view pdf files in vb6 by clicking a cmd button on a form

Posted 28 November 2012 - 02:13 AM

View Postmaj3091, on 28 November 2012 - 02:03 AM, said:

It's not a problem.....have a google on the SHELL function, or look in the forum here, it appears regularly.

If you're so new in VB6, I would be tempted to look at focusing your efforts on the newer VB.Net.

I'm not trying to put you off, but it makes sense to learn a newer language.

Good luck.


Thank you once again.i will look at VB.Net.Have a lovely day
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1