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 / C++ / MFC
  4. Hi All, I have to write a code in VC++ , to convert *.ppt file to *.jpg file,can you tell me how can i do it?????

Hi All, I have to write a code in VC++ , to convert *.ppt file to *.jpg file,can you tell me how can i do it?????

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
5 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    anchorwang
    wrote on last edited by
    #1

    Kindly help me or give me a clue , how can i convert series of ppt slides in abc.ppt to n-number of jpg files. one slide=one jpg file?? programatically using vc++ thanks in advance

    fdsfdsf

    K D 2 Replies Last reply
    0
    • A anchorwang

      Kindly help me or give me a clue , how can i convert series of ppt slides in abc.ppt to n-number of jpg files. one slide=one jpg file?? programatically using vc++ thanks in advance

      fdsfdsf

      K Offline
      K Offline
      Karismatic
      wrote on last edited by
      #2

      For this you have to use the office automation i.e using the some of the tlb files of office u can use the functions that the software provides. here if u see the power point provides a tool called as "Save As" which gives u the facility to convert the .ppt into the jpg file just u hav to u that tool and then u r on the way

      Regards, Pankaj Sachdeva There is no future lies in any job but future lies in the person who holds the job

      1 Reply Last reply
      0
      • A anchorwang

        Kindly help me or give me a clue , how can i convert series of ppt slides in abc.ppt to n-number of jpg files. one slide=one jpg file?? programatically using vc++ thanks in advance

        fdsfdsf

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Saving a PPT file as a JPG file will go something like:

        CString strFileName = "abc.ppt";
        _Application app;
        _Presentation pres;
        COleVariant vtFalse((short) FALSE),
        vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
        vtJpg((short) 17);

        if (app.CreateDispatch("PowerPoint.Application") == TRUE)
        {
        pres = presentations.Open(COleVariant(strFileName), vtOptional, vtOptional, vtOptional);

        strFileName.Replace(".ppt", ".jpg");
        
        pres.SaveAs(COleVariant(strFileName), vtJpg, vtOptional);
        
        docs.Close(vtFalse, vtOptional, vtOptional);
        
        app.Quit(vtOptional, vtOptional, vtOptional);
        

        }


        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        A 1 Reply Last reply
        0
        • D David Crow

          Saving a PPT file as a JPG file will go something like:

          CString strFileName = "abc.ppt";
          _Application app;
          _Presentation pres;
          COleVariant vtFalse((short) FALSE),
          vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
          vtJpg((short) 17);

          if (app.CreateDispatch("PowerPoint.Application") == TRUE)
          {
          pres = presentations.Open(COleVariant(strFileName), vtOptional, vtOptional, vtOptional);

          strFileName.Replace(".ppt", ".jpg");
          
          pres.SaveAs(COleVariant(strFileName), vtJpg, vtOptional);
          
          docs.Close(vtFalse, vtOptional, vtOptional);
          
          app.Quit(vtOptional, vtOptional, vtOptional);
          

          }


          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          A Offline
          A Offline
          anchorwang
          wrote on last edited by
          #4

          Hello DavidCrow! can you give a correct codes Thanks

          fdsfdsf

          D 1 Reply Last reply
          0
          • A anchorwang

            Hello DavidCrow! can you give a correct codes Thanks

            fdsfdsf

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            anchorwang wrote:

            can you give a correct codes

            I gave you 95% of what it would take to solve your problem. Surely you can come up with the balance. :rolleyes:


            "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            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