Sitemap

Know About Life

How to Open a PDF File in VB

2012-09-22   Views:1

Advertisement

Do you need to open a PDF file from a program you're writing in Visual Basic? You can open almost any type of file from within a VB program as long as you know the correct code sequence. One way of opening a file is by coding the open process to a bu

How to Open a PDF File in VB

Do you need to open a PDF file from a program you're writing in Visual Basic? You can open almost any type of file from within a VB program as long as you know the correct code sequence. One way of opening a file is by coding the open process to a button that the user can click. There are many different ways to open a PDF file, but the basic code will work in many of those cases.

Skill level:Moderately Easy

Things you need

Windows computer with a Visual Basic compiler

Instructions

From Default Viewer

1 Create a Private Sub button event to handle the PDF file by using the following code example: "Private Sub ButtonOpen(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOpen.Click End Sub"

2 Use the Process.Start method to open the PDF with the default PDF viewer. For example, use the following code to open "book.pdf" located in the Documents folder: "Process.Start("C:\Documents\book.pdf")", but use a valid location for your PDF file. Place this code before the "End Sub" section.

3 Compile the code and test the results. The button click event opens the PDF file you specified.

From Default Browser

1 Create a Private Sub button event to handle the PDF file by using the following code example: "Private Sub ButtonOpen(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOpen.Click End Sub"

2 Use the WebBrowser.Navigate method to open the PDF with the default Web browser. For example, type the following code before the "End Sub" section: "WebBrowser.Navigate("C:\Documents\book.pdf")", but use a valid location for your PDF file.

3 Compile the code and test the results. The button click event opens the PDF file you specified.

With a Specific Program

1 Create a Private Sub button event to handle Adobe Reader by using the following code example: "Private Sub ButtonOpen(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOpen.Click End Sub"

2 Add the "Adobe PDF Reader" control from your toolbox to the form you are using. Find the AdobeReader.src property and change it to "AdobeReader.src = "C:\Documents\book.pdf"" but use a valid location for your PDF file.

3 Compile the code and test the results. The button click event opens the PDF file you specified within the application window.

Tips and warnings

Before starting this workflow, it is important to have a basic understanding of VB.

You'll need access to a VB compiler to make this code compile and run.

How to Open a PDF File in VB

How to Open a PDF File in VB

Category:Computers & electronicsRelease time:2012-09-22Views:130

Do you need to open a PDF file from a program you're writing in Visual Basic? You can open almost any type of file from within a VB program as long as you know the correct code sequence. One way of opening a file is by coding the open process to a bu[More]

How to Open a PDF File in Java

How to Open a PDF File in Java

Category:Computers & electronicsRelease time:2013-01-19Views:130

PDF files are a filetype developed by Adobe, specifically on their Acrobat systems. One of the major advantages of PDF files is that they retain their formatting when being transferred across systems. Once created it is also more difficult to change[More]

How to Shrink a PDF File

Category:Computers & electronicsRelease time:2012-10-20Views:130

A portable document format (PDF) is an image file type that allows for cross-platform compatibility. By saving your documents, whether they be images or text, with all colour, tint and font info included, as a .PDF, you make it so anyone on a Mac, PC[More]

How to shrink a PDF file that is too large

Category:Computers & electronicsRelease time:2012-06-09Views:130

Adobe designed the Portable Document Format, or PDF, to be a document platform viewable on virtually any modern operating system. The PDF format allows you to create documents in countless applications and share them with others for viewing. You can[More]

How to Paint a PDF File

How to Paint a PDF File

Category:HealthRelease time:2012-09-06Views:130

One of the fun things about computers is playing with programs like Paint. You can use the tools in Paint to add something to a different document. The Paint program can help you make new image files, but it cannot open document or PDF files. While i[More]

How to create writable PDF files

Category:Computers & electronicsRelease time:2013-12-21Views:130

A Portable Document Format, or PDF, file is created by Adobe Acrobat. This file format is less-pixelated and thus more easily read than other word processing documents. Normally PDF files are "Read Only" but using Acrobat you can create writable docu[More]

How to save a PDF file so that others cannot edit

How to save a PDF file so that others cannot edit

Category:Computers & electronicsRelease time:2013-12-25Views:130

A PDF is a file that can be made from a number of different sources. You can convert a Word document, a web page or a file from a design program such as Photoshop or InDesign into a PDF. Thus, it can contain text and graphics. A PDF is often a conven[More]

How to Edit a PDF File in Adobe 8.1 Professional

Category:Computers & electronicsRelease time:2014-01-05Views:130

Features of a PDF file that you are able to edit include the text of the document and deleting pages that are not needed. You need to use the program's advanced editing features to make these changes. Keep in mind that you need to use 8.1 Professiona[More]

How to Open a DAT File in Word

How to Open a DAT File in Word

Category:HomeRelease time:2014-01-26Views:130

A file ending in the DAT extension contains data for a specific program or document on a computer. DAT files are attached to so many types of files that it can be difficult to know what to do with it. A DAT file for a Microsoft Excel document, for ex[More]

How to Change a PDF File to a Word File for Free

How to Change a PDF File to a Word File for Free

Category:Computers & electronicsRelease time:2014-06-11Views:130

PDF files are not compatible with word processing software programs, such as Microsoft Word. This is extremely inconvenient if you need to edit the PDF files on a computer that does not have PDF editing software installed onto it, or if you are sendi[More]

How to Compress a PDF File for Email

How to Compress a PDF File for Email

Category:Computers & electronicsRelease time:2014-07-16Views:130

If you try to include a Portable Document Format (PDF) file as an attachment to an e-mail message, a large file size may prevent you from sending your message. In this scenario, you will need to compress the PDF to a file size suitable for attaching[More]

How to Open a PDF With PHP

Category:Computers & electronicsRelease time:2014-12-31Views:130

Portable Document Format, or PDF, is an open standard developed by Adobe for sharing documents. If you open a PDF file in PHP using the standard function for opening files, you will not be able to understand the contents of the PDF file because it is[More]

How to print multiple PDF files without opening each one

How to print multiple PDF files without opening each one

Category:HobbiesRelease time:2012-02-06Views:130

You may routinely print documents such as books, product manuals and restaurant menus that are stored on a computer as PDF files. Documents saved in Adobe's Portable Document Format look the same on every computer, preserving the layout and fonts wit[More]

How Can I Open a PDF File on My Win98 PC?

Category:Computers & electronicsRelease time:2012-04-28Views:130

Windows 98 is an operating system that does not have a built-in application to open files using the PDF file format. As of 2010, third-party applications that can open PDF files have dropped support for Windows 98. However, you can still use an older[More]

How to Import a PDF File Into Microsoft Word?

How to Import a PDF File Into Microsoft Word?

Category:Computers & electronicsRelease time:2012-04-14Views:130

Portable Document Format (PDF) is a useful format for sending final documents via e-mail or getting them professionally printed. PDFs can be viewed using any PDF reader, such as Adobe Reader, and the format and content cannot easily be changed. In so[More]

How to Open Two Adobe Files Simultaneously

Category:Computers & electronicsRelease time:2013-03-27Views:130

Adobe's various programs, such as Acrobat, Photoshop and InDesign, all have the capability of opening and viewing two files simultaneously. The type of files you can open depend on the program you are using. Acrobat and Reader solely open Portable Do[More]

How to Check a PDF File for a Color System

How to Check a PDF File for a Color System

Category:Computers & electronicsRelease time:2013-05-17Views:130

Since Acrobat's Portable Document Format (PDF) is designed to let you create multipurpose documents---documents designed for optimal printing and display on computers---PDFs support several colour systems, usually called "color space." When you expor[More]

How to Batch Compress PDF Files

How to Batch Compress PDF Files

Category:HealthRelease time:2013-09-30Views:130

Adobe Acrobat software allows you to convert electronic documents of many types to PDF formats, to create new PDFs from scratch and to edit PDFs in a number of ways. You can also use the Acrobat PDF Optimizer to compress PDF files to reduce the PDF f[More]

How to embed a PDF file in Excel

How to embed a PDF file in Excel

Category:Computers & electronicsRelease time:2014-09-05Views:130

Microsoft Excel is a popular spreadsheet tool. Likewise, Adobe's Acrobat Portable Document Format (PDF) is a popular document exchange tool. Embedding a PDF in Excel allows you access to the PDF without a hyperlink to another location for easy access[More]

How to Combine Multiple PDF Files Into One File

Category:Computers & electronicsRelease time:2014-10-15Views:130

Sometimes the elements of a PDF document come together a little at a time. For example, if you have three different people working on different sections of a manual, they will all need to merge their work together when completed. When done, that one[More]

Hot
Commercial leases can set up base rental schedules in several different ways. Whether you have a monthly or yearly lease rate listed in your lease document, you can easily calculate the full amount of your monthly rent if you also know the amount of [More]
A leather belt can make a very sturdy guitar strap, one which you can adjust for playing while standing or sitting down. The holes are already punched in the belt for you, which should make the strap simple to adjust or remove from the guitar. It's a [More]
A roman shade offers a tailored look and ease of use. With its attractive folded layers and its ability to quickly block out light, the roman shade is a bit of both curtain and shade that works well in every room of the house. You can make your own r [More]
Most older metal light fixtures were brass plated, chrome plated or painted with baked-on enamel paint. Due to high humidity in a bathroom, it is common for old bathroom fixtures to rust and corrode. You can refurbish an old fixture by removing the o [More]
You can buy bulk deli meats at a discount by ordering directly from the distributors. Buying deli meats by the ounce from a deli counter is much more expensive than buying wholesale from a distributor. Finding several deli meat distributors will ensu [More]
Box crabs, or shamefaced crabs, get their name from their bulky outer shell. They are called "shamefaced" because their claws fold in front of their faces when they are not using them, making them look like they are covering their faces in shame. Cat [More]
While many people fight to keep ants out of their home, some children and insect enthusiasts own ant farms and keep ants as pets. One benefit of an ant farm is that it doesn't take up a lot of room. An ant farm can also be very interesting as ants te [More]
Supply Chain Management is an all-encompassing field for businesses. It concerns the practice of matching production to sales and ordering supplies to meet the demand of the manufacturing effort to fulfil those sales. This includes purchasing, invent [More]
Identifying a single leaf can lead you down a variety of paths. Some trees have leaflets, which make up a larger leaf, like the ash tree. This can make it difficult to determine the origin of the leaf. Missouri trees include most of the common trees [More]
Computers are not designed to last forever. With time, as new hardware and software is released, all computers will eventually become obsolete. One way to combat this is to upgrade your existing computer, including the amount of storage a computer ca [More]