473,666 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error When Copying from Clipboard to PowerPoint Slide

Ata
Hello,

I am trying to copy the contents of the output of SQL Reporting Services to
a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an
IMAGE stream, which I paste to the Windows clipboard. Then, using automation,
I am trying to copy this information from the clipboard to a PowerPoint
slide. However, I get an error at slide.Shapes.Pa steSpecial.

I am able create a System.Drawing. Bitmap object from the memory stream that
I associate with the image stream. I can also copy an image fragment that I
clipped in MSPaint (which means it's on the clipboard) to PowerPoint using
Automation. And if I generate a CSV stream from Reporting Services, I can
copy this to the clipboard and from there to Excel. It's only that I don't
seem to be able to copy anything from the clipboard to PowerPoint if I pasted
it to the clipboard using the MemoryStream.

Does anyone have any pointers?

Thanks,
Ajay.

ERROR
*****

An unhandled exception of type 'System.Runtime .InteropService s.COMException'
occurred in WindowsApplicat ion2.exe

Additional information: Shapes (unknown member) : Invalid request.
Clipboard is empty or contains data which may not be pasted here.

CODE
****

// Obtain an image stream in "results", which is Byte[]

MemoryStream MemStream = new MemoryStream(re sults);
DataObject d = new DataObject();
d.SetData(DataF ormats.Tiff, MemStream);
Clipboard.SetDa taObject(d, true);

PowerPoint.Pres entation ppt;
PowerPoint.Appl ication pptApp;
PowerPoint.Slid e slide;
pptApp = new PowerPoint.Appl ication();
ppt = pptApp.Presenta tions.Add(MsoTr iState.msoTriSt ateMixed);

slide = ppt.Slides.Add( 1, PowerPoint.PpSl ideLayout.ppLay outBlank)
slide.Shapes.Pa steSpecial(Powe rPoint.PpPasteD ataType.ppPaste Default,MsoTriS tate.msoFalse," ",0,"",MsoTriSt ate.msoFalse);
ppt.SaveAs("D:\ \Ata\\test.ppt" ,
PowerPoint.PpSa veAsFileType.pp SaveAsPresentat ion, MsoTriState.mso True);
Nov 22 '05 #1
0 2473

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
568
by: Ata | last post by:
Hello, I am trying to copy the contents of the output of SQL Reporting Services to a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an IMAGE stream, which I paste to the Windows clipboard. Then, using automation, I am trying to copy this information from the clipboard to a PowerPoint slide. However, I get an error at slide.Shapes.PasteSpecial. I am able create a System.Drawing.Bitmap object from the memory...
2
10202
by: WillRead | last post by:
I have a VB.Net application and a PowerPoint presentation explaining how each form in the application works, etc.. I would like to select and display the slide appropriate for each form by pressing the F1 key. In other words, I want to use the powerpoint presentation for my help system. I am calling the SlideShow from the applications menu, and it works great; however, the same techniques are not working for selecting individual slides. ...
1
2347
by: sofakingfree | last post by:
This error is driving me nuts. The code below will run perfectly when it has a breakpoint. But as soon as I remove the breakpoint and run it normally outside of debug mode I get a strange error message that says: "Microsoft Office PowerPoint has encountered a problem and needs to close. We are sorry for the inconvience. If you were in the middle of something, the information you were working on might be lost."
0
1186
by: excalibur | last post by:
I'm trying to extract data from a database in VB.net and paste it directly into a powerpoint slide. I've tried doing this one cell at a time but that runs too slowly to be practical (lots of data and a very big presentation) so I want to build up an array of data, put it onto the clipboard and then paste it all in one go into powerpoint. I've tried Dim dataArry(NumRows, NumCols) As String 'dataArry gets filled with the data I want to...
0
2016
by: milkyman | last post by:
Hi there, I hope you can help me. I did download some code, from the Microsoft knolidgebase(MSDN), and it's great. I just don't know how to change the code so that it uses a template, thats on my computer, instate of a blank page. Also i want to controle the presentation with a mouse click(or both). Now it's changing a slide after 5 sec. if i press the mouse button nothing hapens. thank you for helping me.... :) here is the code:
1
4035
by: EmmettBrown | last post by:
Hello, Just wondering if anyone can advise. I am trying to remotely control Powerpoint using a microprocessor. I am using RS232 (COM1). The idea is that the microprocessor sends ASCII strings to the PC and Powerpoint changes to the corresponding slide. For example: 01n - Go to slide 1 05n - Go to slide 5 02n - Go to slide 2, etc I have managed to get a VBscript macro going in Powerpoint. Once the show begins I click a button to...
1
2279
by: bsg92150 | last post by:
i have a task that requires me to provide a web use with the ability to send teh current page to a power point slide. and to further complicate matters. the user may want to put the whole site into a slide. the problem is that the information is database driven and the user may not have visted the pages tha/ thankst he is requestion to download. my question is is this possable and is there an example out there that i can look at
0
1163
by: akshar108 via DotNetMonster.com | last post by:
TextFrame (unknown member) : Invalid request. This type of shape cannot have a TextRange i got this error while i m fetching text from textframe which is in the slide my code is following can any one help me to get all text from slide For Each pptSlide In pptDoc.Slides shapes1 = pptSlide.Shapes
1
13916
by: mumbaisalsa | last post by:
hi all, i want to run the slide show say ten slides and then close it , but in my code given below it opens the slide show and closes immediately ... .. please give me a solution to this problem 1. Please add MsPowerpoint11.0 object present in COM in ur references. 2. Code : -- Dim appPowerpoint as Powerpoint.Application
1
11872
by: chrizstone | last post by:
Hi Guys, What i want to do is: I want to create a Slide programmatically where a Table is on it! Here´s my Code: String strTemplate; strTemplate = template; String tableSlide = @"C:\Temp\TableSlide_" + guid.ToString();
0
8449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8360
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8642
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1777
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.