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. C#
  4. Word & PDF document

Word & PDF document

Scheduled Pinned Locked Moved C#
6 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.
  • S Offline
    S Offline
    Sajjad Leo
    wrote on last edited by
    #1

    Hello, I have a form in c # and two buttons on form, i want to open word document file on click on one button and an other button click i want to open PDF file. what should i do should i add any reference or what code is required. please do replay Thanx

    M 1 2 Replies Last reply
    0
    • S Sajjad Leo

      Hello, I have a form in c # and two buttons on form, i want to open word document file on click on one button and an other button click i want to open PDF file. what should i do should i add any reference or what code is required. please do replay Thanx

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      You need to locate the file(s) see IO.FileInfo Then use this search to begin your research on how to open a word document[^] and this one to open a pdf file[^]

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • S Sajjad Leo

        Hello, I have a form in c # and two buttons on form, i want to open word document file on click on one button and an other button click i want to open PDF file. what should i do should i add any reference or what code is required. please do replay Thanx

        1 Offline
        1 Offline
        12Code
        wrote on last edited by
        #3

        Sajjad Leo wrote:

        want to open word document file on click on one button

                private void btnExeDoc_Click(object sender, EventArgs e)
                {
                    try
                    {
                        Process.Start("report.doc");
                    }
                    catch (Win32Exception ex)
                    {
                        MessageBox.Show(ex.Message);                
                    }
                }
        
        S 1 Reply Last reply
        0
        • 1 12Code

          Sajjad Leo wrote:

          want to open word document file on click on one button

                  private void btnExeDoc_Click(object sender, EventArgs e)
                  {
                      try
                      {
                          Process.Start("report.doc");
                      }
                      catch (Win32Exception ex)
                      {
                          MessageBox.Show(ex.Message);                
                      }
                  }
          
          S Offline
          S Offline
          Sajjad Leo
          wrote on last edited by
          #4

          Dear your code is not working i am trying it but there is problem. let me explain it again i want to display text file and pdf file on the button click. i need this only.

          1 1 Reply Last reply
          0
          • S Sajjad Leo

            Dear your code is not working i am trying it but there is problem. let me explain it again i want to display text file and pdf file on the button click. i need this only.

            1 Offline
            1 Offline
            12Code
            wrote on last edited by
            #5

            Hi dear, Pls remember to add using System.Diagnostics;

            8.Kelvin()
            {
            while (!(the machine can program itself))
            Wont_stop_coding = true;
            }

            S 1 Reply Last reply
            0
            • 1 12Code

              Hi dear, Pls remember to add using System.Diagnostics;

              8.Kelvin()
              {
              while (!(the machine can program itself))
              Wont_stop_coding = true;
              }

              S Offline
              S Offline
              Sajjad Leo
              wrote on last edited by
              #6

              I have done this, but its path which i given in code is in C drive but if i want to add file in solution explore then is their any different technique for displaying ms word file or pdf file.

              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