473,383 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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.PasteSpecial.

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.InteropServices.COMException'
occurred in WindowsApplication2.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(results);
DataObject d = new DataObject();
d.SetData(DataFormats.Tiff, MemStream);
Clipboard.SetDataObject(d, true);

PowerPoint.Presentation ppt;
PowerPoint.Application pptApp;
PowerPoint.Slide slide;
pptApp = new PowerPoint.Application();
ppt = pptApp.Presentations.Add(MsoTriState.msoTriStateMi xed);

slide = ppt.Slides.Add(1, PowerPoint.PpSlideLayout.ppLayoutBlank)
slide.Shapes.PasteSpecial(PowerPoint.PpPasteDataTy pe.ppPasteDefault,MsoTriState.msoFalse,"",0,"",Mso TriState.msoFalse);
ppt.SaveAs("D:\\Ata\\test.ppt",
PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, MsoTriState.msoTrue);
Nov 22 '05 #1
0 2445

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

Similar topics

0
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...
2
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...
1
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...
0
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...
0
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...
1
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...
1
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...
0
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...
1
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...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.