Create PPT

Hi,
I have one excel sheet with 2 buttons. My goal is to take screenshot by pressing PrintScreen button and paste them into Powerpoint followed by clicking on button1. Means, if I click on button 1, it will add screenshots to powerpoint whenever user press PrintScreen
button until and unless the button2 is pressed. If I click on Button 2 it will prompt for a path to save newly created Powerpoint. I have one piece of code that will capture screenshot but it is not capable of handling PrintScreen button manually. 
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Const VK_SNAPSHOT As Byte = 44
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal _
nCmdShow As Long) As Long
Private Const SW_SHOWMAXIMIZED = 3
Private Const VK_LCONTROL As Long = &HA2
Private Const VK_V = &H56
Private Const KEYEVENTF_KEYUP = &H2
Private Sub CommandButton1_Click()
Dim IE As Object
Dim hwnd As Long, IECaption As String
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "www.Google.com"
Sleep 5000
IECaption = "Google - Windows Internet Explorer"
hwnd = FindWindow(vbNullString, IECaption)
If hwnd = 0 Then
MsgBox "IE Window Not found!"
Exit Sub
Else
ShowWindow hwnd, SW_SHOWMAXIMIZED
End If
DoEvents
Call keybd_event(VK_SNAPSHOT, 0, 0, 0)
Dim newPowerPoint As PowerPoint.Application
Dim activeSlide As PowerPoint.Slide
On Error Resume Next
Set newPowerPoint = GetObject(, "PowerPoint.Application")
On Error GoTo 0
If newPowerPoint Is Nothing Then
Set newPowerPoint = New PowerPoint.Application
End If
If newPowerPoint.Presentations.Count = 0 Then
newPowerPoint.Presentations.Add
End If
newPowerPoint.Visible = True
newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutText
newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count
Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)
activeSlide.Shapes.Paste
' Set myShapeRange = activeSlide.Shapes(activeSlide.Shapes.Count)
' myShapeRange.Left = 234
' myShapeRange.Top = 186
End Sub
Also, while the code paste a screenshot in Powerpoint, I want it to be in a size same as a slide's size. However currently it is going beyond the slide area.

Hi Edward,
Thanks for your reply. I don't have any problem with win32 level API. My requirement is like whenever user press printscreen button system should open one presentation and add the screenshot in each slide until user press End button. Once user press End
button it should not paste any more screenshot to the slide and save the powerpoint to a path  mentioned in the code. Please find below the code that I'm using. Please insert a button in excel sheet and paste the following code.
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_SNAPSHOT = &H2C
Private Const VK_MENU = &H12
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public bEsc, bScr, Comment, step_count, Val, Path, ins_comments, show_alert
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "User" (ByVal hWnd As Integer) As Integer
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub CommandButton1_Click()
Dim newPowerPoint As PowerPoint.Application
Dim activeSlide As PowerPoint.Slide
On Error Resume Next
Set newPowerPoint = GetObject(, "PowerPoint.Application")
On Error GoTo 0
If newPowerPoint Is Nothing Then
Set newPowerPoint = New PowerPoint.Application
End If
If newPowerPoint.Presentations.Count = 0 Then
newPowerPoint.Presentations.Add
End If
newPowerPoint.Visible = True
For j = 1 To 300
For i = 1 To 100000
If (GetAsyncKeyState(44)) Then
newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutText
newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count
Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)
activeSlide.Shapes.Paste
End If
If (GetAsyncKeyState(35)) Then
strPpPath = "C:\Users\Jo\Desktop\Testing!!"
strPpName = strPpPath & "\" & "newPresentation1.pptx"
newPowerPoint.SaveAs Filename:=strPpName
Exit Sub
End If
Next i
Next j
End Sub
Now the following problems I have
1.Code is not able to save file in the given path. I'm getting "Method or Data Member Not Found Error".
2. If I wait for more than 15seconds to take a screenshot after pressing Commandbutton code is not working. I want after clicking commandbutton code should be activated and it should remain active until the user press End button. As per my current code system
stop taking screenshot after 15 seconds. 
3.If any powerpoint file open prior running the code, system is not able to create new powerpoint. Thus the code is getting failed.
Could you please help me modifying the code so that I can get the desired output.
Thanks..

Similar Messages

  • Problem opening Keynote 08 created PPT in Windows Office 2007

    After creating my presentation in iWork08 Keynote I save it first in its native format, and then in PPT. When I try to open the PPT in Office 2007 on a WIndows machine, all I get is an empty Window. If I open it in Office 2003, no problems. If I then save it in Office XP/2003 format, Office 2007 can then read it without issues. Has anyone else seen this behaviour, and if you have, have you been able to resolve it at all?

    I've had the exact same problem running Vista and Office 2007 except I don't have the luxury of having another computer with Office 2003. Does anyone know of a fix? This totally makes buying windows useless as a way to check ppts that we export from Keynote. Can apple fix this?
    -Grant

  • Can I create ppt file in actionscript 3 adobe air?

    Is it possible to create a Microsoft ppt file in actionscript 3 adobe air?

    Since you have her file, what happens if you open her file and place the image without first making and selecting a frame? Is it the same size as the image in the frame?
    >Yes when I make the frame, place the image, fit the image to the frame, it reads 42% -(then 100% when selected with the black arrow tool) this is the way I believe it should be.
    Unless the frame you create is exactly the same size as the image you place into it, it will always change size if you fit the image to the frame. If the frame is smaller, the image will have to be made smaller to fit into the frame. The same applies to a larger frame.
    I don't get the impression that you are confusing scaling with cropping, but it should be mentioned that you can have a 100% size image in a smaller frame if part of the image is outside the boundries of the frame.
    Also, I mentioned in an earlier post that the most likely error would be that the image in the original isn't the same (has the same name, but has been changed in its original program) as the image you are trying to place, even if your San Fran designer sent it to you (she could have sent you the wrong image). If you open her file and package it, it will spit out a copy of the image, which you can try placing to see if you still get the same results.

  • MOV files from Ipad not playing correctly in 2010 Windows PPT presentation

    I inserted .mov files taken from Ipad 2 into a.ppt on my work PC. I saved these files to the folder containing all of the videos I am showing in the ppt-- the same folder where the .ppt is located as well.  Then I inserted them as I do all videos (I create ppts often for work) -- and  the clips that are horizontal play fine but the vertical ones do not play correctly- audio and video not in sync.  any remedies?  (using ppt 2010, converted files to wmv, didn't work either).   I should add that when I viewed these files on my PC (by just clicking the file) they play fine, but they are not rotated correctly.  This must have been my fault when I took the videos.  However, when I insert them they are rotated correctly but just don't play right - looks like a Japanese movie.    please help!

    Your page code doesn't give instructions to any browser plug-in and uses the out of date "embed" tag:
    embed src="hippiehouseshowreel09.mov" width="460" height="360" hspace="2" align="left"></embed
    The same code is used at all of your other popup windows and Internet Explorer doesn't know what to do (so it does nothing).
    <a class="jive-link-external-small" href="http://">http://developer.apple.com/internet/ieembedprep.html shows the more modern code that works with all browsers.
    http://www.qtbridge.com/pageot/pageot.html free software that can help write perfect code.

  • URGENT: Need to make ppt files in applet

    Hi,
    I need to read ppt files from client machine from applet and create a new ppt file at client's machine. Can i do this with signed applets ?
    Also from where i can get ppt java library in order to create ppt files ?
    Thanks in advance.

    what filetype is ppt??
    is it microsoft powerpoint - if so: http://jakarta.apache.org then check the POI project and let me know if it worked!

  • Operation on ppt

    I am developing  a project operate ppt files , in C#,generate a ppt directly after processing the data.But when I
    am add the charts, i can only add the chart frame, I need to input data then the chart can be correct. How to add chart to excel with data without input?
    This is my code:
    private void chartButton_Click(object sender, EventArgs e)
    string path = pptPathTextBox.Text;
    OpenPPT(path);
    //Add a new slide
    int count = presentation.Slides.Count;
    presentation.Slides.Add(count + 1, PPT.PpSlideLayout.ppLayoutBlank);
    //Add a pie chart
    slide = presentation.Slides[count + 1];
    Graph.Chart aChart = (Graph.Chart)slide.Shapes.AddOLEObject(150, 150, 480, 320,"MSGraph.Chart.8", "", MsoTriState.msoFalse, "", 0, "",MsoTriState.msoFalse).OLEFormat.Object;
    aChart.ChartType = Graph.XlChartType.xl3DPie;
    aChart.Legend.Position = Graph.XlLegendPosition.xlLegendPositionBottom;
    aChart.HasTitle = true;
    aChart.ChartTitle.Text = "It is a pie chart";

    Try to use this
    Excel library, it can generate and edit many kinds of charts, add charts to powerpoint code here:
    private void btnRun_Click(object sender, EventArgs e)
    //create PPT document
    Presentation presentation = new Presentation();
    //set background Image
    string ImageFile = "bg.png";
    RectangleF rect2 = new RectangleF(0, 0, presentation.SlideSize.Size.Width, presentation.SlideSize.Size.Height);
    presentation.Slides[0].Shapes.AppendEmbedImage(ShapeType.Rectangle, ImageFile, rect2);
    presentation.Slides[0].Shapes[0].Line.FillFormat.SolidFillColor.Color = Color.FloralWhite;
    //insert chart
    RectangleF rect = new RectangleF(presentation.SlideSize.Size.Width / 2 - 200, 100, 400, 400);
    IChart chart = presentation.Slides[0].Shapes.AppendChart(Spire.Presentation.Charts.ChartType.Cylinder3DClustered, rect);
    //add chart Title
    chart.ChartTitle.TextProperties.Text = "Report";
    chart.ChartTitle.TextProperties.IsCentered = true;
    chart.ChartTitle.Height = 30;
    chart.HasTitle = true;
    //load data from XML file to datatable
    DataTable dataTable = LoadData();
    //load data from datatable to chart
    InitChartData(chart, dataTable);
    chart.Series.SeriesLabel = chart.ChartData["B1", "D1"];
    chart.Categories.CategoryLabels = chart.ChartData["A2", "A7"];
    chart.Series[0].Values = chart.ChartData["B2", "B7"];
    chart.Series[0].Fill.FillType = FillFormatType.Solid;
    chart.Series[0].Fill.SolidColor.KnownColor = KnownColors.Brown;
    chart.Series[1].Values = chart.ChartData["C2", "C7"];
    chart.Series[1].Fill.FillType = FillFormatType.Solid;
    chart.Series[1].Fill.SolidColor.KnownColor = KnownColors.Green;
    chart.Series[2].Values = chart.ChartData["D2", "D7"];
    chart.Series[2].Fill.FillType = FillFormatType.Solid;
    chart.Series[2].Fill.SolidColor.KnownColor = KnownColors.Orange;
    //set the 3D rotation
    chart.RotationThreeD.XDegree = 10;
    chart.RotationThreeD.YDegree = 10;
    //save the document
    presentation.SaveToFile("chart.pptx", FileFormat.Pptx2010);
    System.Diagnostics.Process.Start("chart.pptx");
    //function to load data from XML file to DataTable
    private DataTable LoadData()
    DataSet ds = new DataSet();
    ds.ReadXmlSchema("data-schema.xml");
    ds.ReadXml("data.xml");
    return ds.Tables[0];
    //function to load data from DataTable to IChart
    private void InitChartData(IChart chart, DataTable dataTable)
    for (int c = 0; c < dataTable.Columns.Count; c++)
    chart.ChartData[0, c].Text = dataTable.Columns[c].Caption;
    for (int r = 0; r < dataTable.Rows.Count; r++)
    object[] data = dataTable.Rows[r].ItemArray;
    for (int c = 0; c < data.Length; c++)
    chart.ChartData[r + 1, c].Value = data[c];

  • Displaying PPT 2007 files

    Hello - our application used to use the RavWare PPTViewer
    Xtra for embedding PPT files within it and gave us neat controls
    like working out the page that had been viewed. It relied on
    PPTViewer97 and there was also a beta version which supported
    PPTViewer2003. However times have moved on and now our clients are
    creating PPTs using PowerPoint 2007 which saves files as PPTX and
    these can only be viewed using PPTViewer2007 and none of the
    previous versions. Does anyone know of an Xtra that works with
    PPTViewer2007 or has anyone got any good ideas how we could mimic
    our previous "PPT embedded within Director" functionality? Thanks
    Ed.

    You could try an ActiveX control using either the 'built-in'
    ActiveX
    xtra or Xtramania's ActiveCompanionSet:
    <
    http://www.xtramania.com/Products/ActiveCompanion/>

  • Timing appearance of PPT slideshow elements after importing to Captivate

    I know that in Captivate I can import PPT slides along with
    the animations (bullet points appearing one at a time, etc.), and
    that if these are timed in PPT, the timing can be preserved on the
    Captivate timeline after importing... However, do you have to time
    the bullet points coming up while in PPT, or is there a way to
    import PPT slides and then control the appearance of bullet points
    or other objects within Captivate (to match up with audio narration
    recorded outside of PPT, for example)?
    What we are trying to achieve is to have Subject Matter
    Experts create PPT slides and narration that will go along with
    them, then record the narration and produce a narrated presentation
    through Captivate that synchs the narration with the appearance of
    visual elements in the PPTs.

    Larry Walther described a method for controlling the timing
    of animations in imported PowerPoint slides in this message. It
    sounds as if you have a similar situation.
    Link
    to Message
    Phil

  • Flex and Java on Desktop

    Hi
    We are having this requirement , we want to develop a
    application using flex for adobe AIR runtime which will communicate
    with java in the desktop, we are not having any servers here, so
    flex application want to communicate with java classes with out the
    help of any server so I can't use httpservice, webservice or
    remoting .
    I like to know the ways to communicate from flex 3.0(Adobe
    AIR) to java files (java takes care of splitting PowerPoint
    files and converting it into serious of jpeg files, and
    creating ppt files from the objects returned from flex ).
    Is there any other way to communicate form between flex and
    java in the desktop ??? please give inputs
    Thiru

    Hi,
    you could use XMLSocket or Socket classes depending on the
    type of communication you want to stablish.
    I have been testing this for a while although not for a
    project.
    However my impression is that you need to install the AIR app
    which is self-extracted and installed, but in second hand, you have
    to install the Java app, that acts as a server, and it must be
    executed every time your AIR app is, and the other way around.
    Untill now I haven't got any idea on doing this without too
    much work, but you can take a look at the Merapi project.
    Manu

  • Broken image when exported to MS power point presentation

    Hello All,
    I am having issues with Xcelsius, I always export dashboard into a powerpoint presentation and for some odd reason today it shows up as a broken window.  The file I am working on has 2 .swf files along with a selector which switches between both files.  When I export the file and it opens up in powerpoint everything works smoothly but once I save it and re-open it, that's when the broken image comes up.  Please does anyone know what could be causing this issue?  I need to get this fixed asap because this is for a presentation   Below is what it looks like.
    [http://img376.imageshack.us/img376/9789/picture1z.jpg]

    Hi, XcelLovr
    I have experienced the same thing with Microsoft Office 2007.  I had created PPT presentation, it had worked fine but after reopening it became broken. I solved this problem and now it works fine.
    Unfortunately, I don't have determined solutions but I recommend to try the next things which I did:
    1. Install the FP2.1 on Xcelsius
    2. Decrease security in Powerpoint  Macro Settings -> "Enable all macros",
    ActiveX Settings - "Enable all controls"
    3. Install the last version of Flash player (http://get.adobe.com/flashplayer/)
    4. Clean temp folders - as I understand Xcelsius firstly creates tmp file inside Temp folder then Xcelsius tries to make it embedded inside Powerpoint presentation. So, the problem can be connected with this thing.
    4. Try to manually insert Xcelsius objects into Powerpoint presentation:
        - Create SWF file inside Xcelsius
        - Create powerpoint presentation by using Microsoft Powerpoint
        - Save it as PPT (2003 version)
        - Open Developer Tab (if it's hidden you should make it visible) inside Powerpoint
        - Click Insert control on this Developer tab (icon with hammer and forceps) in Powerpoint
        - Choose Shockwave Flash Objects in appeared long list "More control"
        - Draw the control on a slide
        - Choose the control and click properties
        - Find Movie property, indicate destination of your SWF file
        - Make EmbedMovie "True" - it will put SWF file inside PPT presentation
       -  Save and check
    By the way, I found a property there "FlashVars" it seems that it's possible to integrate different Xcelsius objects inside presentation by using Visual Basic and this property.
    5. Try to install Office 2003 with deleting office 2007
    Perhaps, my recommendation will help you to solve the problems.
    Pavel

  • Powerpoint Narration not in Presenter-Published swf

    1) Create PPT slide show
    2) Record audio on slide with PowerPoint narration recorder (used to manage timing on slides and animations)
    3) Playback PPT slide show: audio is present, timings work
    4) Publish to "My Computer" with Presenter (version 7.07)
    5) Open HTML/SWF in browser window to playback published slide show
    6) NO AUDIO
    Any help? Thanks.
    Do I have to use the Presenter audio recorder and the "next" button on the tiny-little-hard-to-work-with recorder popup to make it work? (sorry for the editorializing)
    Why doesn't Presenter use the narration and timings generated by PowerPoint and from within PowerPoint?
    Michael
    eLS 2.5 (etc.)

    Heyward is correct. The short version of the answer is that Presenter has to build the presentation in Flash using server rules. Thus cannot make local file path calls, which is where the audio would reside if in PPT. So, you should be able to open the Import Audio tool and there should be a button for importing the PPT audio. Keep in mind that this will not keep your timings created in PPT, but is easily fixed in the Sync Audio tool.
    Not sure what you are talking about with the Presenter Audio recorder, as once you know how it works, recording audio is no harder (possibly easier) than doing the same thing in PPT.
    As to why doesn't it translate the info from PPT? Well, it is an Adobe product living in a MS product. So, MS writes the rules as to what the visibility and integration can be with their tools. So you are seeing the result of two software houses in one place. Is it perfect? No, but it is a pretty wonderful tool to use. I say that as a user of Presenter for the past 6+ year. The biggest thing that I see is people have false or unreasonable expectations of the tool itself. It all comes down to honestly knowing what it will and won't do, and the best practices for getting it done. If needed, you may want to look at a traditional class for Presenter. It's amazing what you can learn, and learn to avoid, if you are set up to succeed from the beginning. 
    Feel free to PM me if you want, as I do teach Presenter, or there are plenty of great resources out there if you need them.

  • CP5.5 - PDF Output - should it retain Relative Links to Data?

    I am creating PPT slides with animation, then importing into CP5.5.
    In CP5.5 I add some relative links (such as DataSupport.zip) to one slide.
    Why doesn't the Adobe PDF maintain the Relative Link and try to open the zip file (the data support file is in the same folder as the PDF) ?

    I am creating PPT slides with animation, then importing into CP5.5.
    In CP5.5 I add some relative links (such as DataSupport.zip) to one slide.
    Why doesn't the Adobe PDF maintain the Relative Link and try to open the zip file (the data support file is in the same folder as the PDF) ?

  • Convert powerpoint to htm(save as web page) and htm to powerpoint

    Hi,
    Using powerpoint we can save the powerpoint file to web page. Doing this will create bundle of xml and htm files along with starting index page. Clicking on index page will start the presentation. Is there any apis by which powerpoint files can be saved as htm(which creates bundle of htm and xml files) also vice versa. I am trying to do this. But there is no luck yet. For me converting the htm files to powerpoint is very important. This is easily done by opening the htm file in powerpoint and then say save as ppt.
    Please let me know if anybody has some idea on this.
    Anand

    In my application i am creating a html powerpoint presentation which is the end output. You can save the normal powerpoint presentaion as web page using microsoft powerpoint. This will create a html presentation. I have used this template to create htm powerpoint presentation.
    Now user wants it to be one single file while htm presentation contains bundle of xml and htm files. How can i create ppt from this htm files.

  • Screen captures fuzzing once on Breeze server

    We are creating PPTs and then convert into Breeze to post on
    our Breeze server. The screen captures look good on the PPT even
    after it is pulblised. Once it is posted to the Breeze server and
    run the screen shots are almost unreadiable.
    Any suggestions?
    Should I be using a specific screen resolution or type? when
    I capture?
    Thanks

    If you are publishing from Breeze Presenter is may be the
    image quality setting you're using. In Presenter go to the
    Breeze>Preferences menu, then select the "Quality" tab, if the
    image quality is low set it to medium, if it's already medium, set
    it to high.

  • Can I listen and view a pptx in keynote?

    Hi!
    I'm a student and we have lectures that ar recorded in pptx or ppt. Can I listen and view the in keynote?
    I have'nt  bought keynotes yet and I want to know if I can use it before I buy it.
    Another quastion is, can I create ppt or pptx files in keynote?

    importing and exporting ppt files is not 100% but it does work well from simple presentations
    ppt files that have different fonts, builds or transitions that have a coresponding  match, wont transfer
    Keynote  exports ppt files, not pptx files

Maybe you are looking for