Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB.Net: Programmatically previewing any system supported document type

VB.Net: Programmatically previewing any system supported document type

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mbire
    wrote on last edited by
    #1

    Hi guys, Is there a way/control for previewing any document supported by the a windows system from vb.net?:-> thanks:->

    L D 2 Replies Last reply
    0
    • M Mbire

      Hi guys, Is there a way/control for previewing any document supported by the a windows system from vb.net?:-> thanks:->

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, the Process.Start() method lets you open a document, using the application that got associated to the file's extension. It is equivalent to double-clicking a file in Windows Explorer; so al of this happens outside your app. the WebBrowser class lets you open a number of document types (mtml, doc, ppt, xls, ...) inside your app. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


      M 1 Reply Last reply
      0
      • M Mbire

        Hi guys, Is there a way/control for previewing any document supported by the a windows system from vb.net?:-> thanks:->

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        If you're talking about how you see it in Explorer, where you single-click on a file, say a JPG, and you see a smalle preview in the Explorer window, then no there isn't. You'd have to write a parser, and renderer, for every document type you want to support. That's just not feasible.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        M 1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, the Process.Start() method lets you open a document, using the application that got associated to the file's extension. It is equivalent to double-clicking a file in Windows Explorer; so al of this happens outside your app. the WebBrowser class lets you open a number of document types (mtml, doc, ppt, xls, ...) inside your app. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


          M Offline
          M Offline
          Mbire
          wrote on last edited by
          #4

          Hi, The WebBrowser control is actually doing what I want, thanks. For PDF, picture formats etc its working fine i.e. it opens the file and displays it within the browser control, but when it comes to office documents, I get a File Download dialog box which then goes on to start the office application and open the document there or downloads the file to disk. Is there a way around this so that even office type documents are loaded but their applications are embedded within the WebBrowser control? Thanks,

          L 1 Reply Last reply
          0
          • D Dave Kreskowiak

            If you're talking about how you see it in Explorer, where you single-click on a file, say a JPG, and you see a smalle preview in the Explorer window, then no there isn't. You'd have to write a parser, and renderer, for every document type you want to support. That's just not feasible.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            M Offline
            M Offline
            Mbire
            wrote on last edited by
            #5

            Hi Dave Thanks for your response, however i think u should take a look at this link: http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=266903&cmonth=11&cyear=2005 Its possible to have thumbnails, also using the WebControl allows u to open most documents effortlessly. Just: WebControl1.Navigate("c:\book.pdf") Thanks

            D 1 Reply Last reply
            0
            • M Mbire

              Hi, The WebBrowser control is actually doing what I want, thanks. For PDF, picture formats etc its working fine i.e. it opens the file and displays it within the browser control, but when it comes to office documents, I get a File Download dialog box which then goes on to start the office application and open the document there or downloads the file to disk. Is there a way around this so that even office type documents are loaded but their applications are embedded within the WebBrowser control? Thanks,

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Hi, Seems like yours is a web app, not a Windows app; I dont know for these. I have been using shdocvw.dll (the precursor of WebBorwser) since .NET 1.1 in Win app, and it shows office documents without dialogs. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


              1 Reply Last reply
              0
              • M Mbire

                Hi Dave Thanks for your response, however i think u should take a look at this link: http://www.gamedev.net/community/forums/mod/journal/journal.asp?jn=266903&cmonth=11&cyear=2005 Its possible to have thumbnails, also using the WebControl allows u to open most documents effortlessly. Just: WebControl1.Navigate("c:\book.pdf") Thanks

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Yeah, but for that to work, you have to have something installed that knows what a PDF is and how to render it, like Adobe Acrobat Reader. Without it, the web browser control doesn't know a damn thing about the PDF and can't render it. The same goes for Excel files, Word documents, AutoCad drawings, ...

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups