Results 1 to 3 of 3

Thread: How do I load file in .rtf or .pdf files in vb

  1. #1
    Join Date
    Mar 2009
    Location
    Ghana
    Posts
    15

    How do I load file in .rtf or .pdf files in vb

    I will like to load .pdf file or .rtf which i have my help on it when running my vb program.
    How i i go by it.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How do I load file in .rtf or .pdf files in vb

    The simplest solution is to load the file into a RichTextBox control.
    The plain text will be returned by the control's .Text property:

    Dim sText As String

    With rtfText
    .FileName = "C:\Temp\Test01.rtf"
    sText = .Text
    End With

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How do I load file in .rtf or .pdf files in vb

    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

    ShellExecute 0&, "open", fileName, "", "", vbNormalFocus

    this works for me

    you could alternatively consider to use the pdf.ocx ( shipped woth the reader )

    just add it to your project then you can also easily print the pdf etc etc

Similar Threads

  1. Office 2010 Will Not Load Help Files
    By Iopeter in forum Windows Software
    Replies: 5
    Last Post: 09-12-2011, 12:44 PM
  2. Ways to Save Files When Windows Won’t Load?
    By Nitnam in forum Operating Systems
    Replies: 5
    Last Post: 28-05-2011, 10:11 AM
  3. How to load avi file to DVD
    By Zavier in forum Windows Software
    Replies: 5
    Last Post: 14-01-2010, 01:51 AM
  4. Word and Excel files slow to load.
    By Susan Bradley in forum MS Office Support
    Replies: 5
    Last Post: 20-06-2009, 01:46 AM
  5. Load video files more quickly
    By Maddox in forum Customize Desktop
    Replies: 0
    Last Post: 24-12-2008, 02:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,389,994.93828 seconds with 16 queries