none
Clipboard.GetData("Office Drawing Shape Format") not working on PowerPoint 2013 RRS feed

  • Question

  • I have created PowerPoint add-in using VB.NET 2008. I have added ShockwaveFlash object in PowerPoint slide. Now I want to retrieve this ShockwaveFlash object. For this I have copy the PowerPoint shape by PowerPoint.Shape.Copy() method. It goes to Clipboard object. Now I am trying to get this shape object from Clipboard by Clipboard.GetData("Office Drawing Shape Format") method. This method works in PowerPoint 2003, 2007 and 2010. When I try same thing on PowerPoint 2013, I didn't get any data from Clipboard. Could you please help me to resolve this issue?

    Thanks for your help.

    Wednesday, April 10, 2013 10:12 AM

All replies

  • In PowerPoint object model, you can try to use Paste method to paste the contents of the Clipboard,  I suggest the data which copy to clipboard damaged, So it can not get data, and is there any error message pop up by using Clipboard.GetData method ?
    Wednesday, April 10, 2013 2:13 PM
  • Thanks for your reply.

    I didn't get any error while retrieving data from clipboard, it just return nothing.  I don't think, data is damaged.  Because same code works on all PowerPoint, except 2013.  I cann't use Paste method, because I want to extract ShockwaveFlash object. I dont want to paste copied data on other PowerPoint  slide. I need copied data from clipboard for my further processing.


    • Edited by archash Friday, April 12, 2013 4:47 AM
    Friday, April 12, 2013 4:46 AM
  • Can you share the project to skyDrive and give me the link so that i can test on my machine and help you solve the problem quickly.

    Thanks


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer.

    Friday, April 12, 2013 4:08 PM
  • I cann't share our code. I will provide the code snippet.

    We have created PowerPoint addin using C# 2008. In that addin, Code Snippet as follows:

    //PowerPoint Shape object

    PowerPoint.Shape _shape = null;

    //Collection of Flash objects

    Dictionary<ShockwaveFlashObjects.ShockwaveFlash, PowerPoint.Shape> _activities = null;

    //We added the Flash objects in _activities collection

    //And now we trying to retrieve these Flash objects

    //Find shape object for selected key
    foreach (KeyValuePair<ShockwaveFlashObjects.ShockwaveFlash, PowerPoint.Shape> activity in _activities)
    { ShockwaveFlashObjects.ShockwaveFlash flash = activity.Key as ShockwaveFlashObjects.ShockwaveFlash;

     _shape = activity.Value as PowerPoint.Shape;     

    _shape.Copy();

    if (Clipboard.GetDataObject() != null)
    {               

    //Get shape data onto the disk.
    if (Clipboard.ContainsData("Office Drawing Shape Format"))
    {  

    }

    }

    }

    Here Clipboard.Contains method is not returning any data.

    I hope this helps you.

    Wednesday, April 17, 2013 7:10 AM
  • If this not work only in PowerPoint 2013, I this this will be a issue with PowerPoint 2013, The Shape.Copy method don't past the object to Cliboard, I think you can use  Cliboard.SetData method to copy the object to Cliboard.

    Thanks


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Wednesday, April 17, 2013 9:38 AM
  • Thanks for your reply.

    I tried Clipboard.SetData method. Now Clipboard.ContainsData("Office Drawing Shape Format") returns true on PowerPoint 2013. But when I tried to get actual data by:

    Clipboard.GetData("Office Drawing Shape Format")

    Or

    Clipboard.GetData(System.Windows.Forms.Clipboard.GetDataObject().GetFormats()[0])

    It returns "null". How to retrieve the data from clipboard? Please help me.

    Friday, April 19, 2013 11:31 AM
  • Hi archash, 

    If this question use Clipboard.SetData method successfully, Then you can mark this question and ask this question on WinForms forum, because Clipboard is winForm class, I think you can get more help form that forum. 

    The forum address: http://social.msdn.microsoft.com/Forums/en-US/winforms/threads.

    Thanks.


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Monday, April 22, 2013 2:08 AM
  • I have added this question in WinForms forum. They again suggested to move on VSTO forum.

    When I copy the PowerPoint Shape object by PowerPoint.Shape.Copy(), it saves Shape object into Clipboard and when I tried to retrieve it by Clipboard.GetData("Office Drawing Shape Format") method, it fails only on PowerPoint 2013. The same code works on PowerPoint 2003, 2007 and 2010.

    Is this PowerPoint 2013 bug? Or Api of .Net 2008 is not working on PowerPoint 2013?

    I am trying to find a solution which should work on all PowerPoint.


    Monday, April 22, 2013 12:13 PM
  • What is vsrsion of your Office 2013 and version of Visual studio, OS. Please give more information about those, I will test this issue in the same environment on my side. Thanks.

    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Monday, April 22, 2013 1:50 PM
  • A null GetData result is normal for delay rendering. Delay-rendering is very common in Office clipboard formats as Office often deal with large amount of data.

    The Office team is free to choose how it operates the clipboard, for example move the "Office Drawing Shape Format" format from early-rendering to delay-rendering, or change the native format for this format id. There is no documentation on this clipboard format, so you should not write code that assumes the existence of the clipboard format. The clipboard format may very well disappear in next Tuesday's Office security update.



    Visual C++ MVP


    Monday, April 22, 2013 9:51 PM
  • We are using

    1. Win 8 - 64 bit OS

    2. MS Office 2013 (15.0.4420.1017) MSO(15.0.4420.1017) : 32 bit

    3. Visual Studio 2008 : Professional Edition

    Tuesday, April 23, 2013 5:09 AM
  • As Sheng Jiang said that this issue is very common, The office Team will release an update in next Tuesday, So now this is an issue which have no solution to solve that, you should wait the update of Office Team. Thanks.

    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Tuesday, April 23, 2013 5:12 AM
  • Thank you for all replies.  I will wait for next Office update. I hope this update will resolve my issue.
    Tuesday, April 23, 2013 6:18 AM
  • Welcome, So please help to close this thread and If the issue don't solve in next office update, you can ask this issue here again. you also share the issue solution if the next update solve this question. 

    Thanks a lot.


    If my post is helpful,please help to vote as helpful, if my post solve your question, please help to make it as answer. my sample

    Tuesday, April 23, 2013 6:35 AM
  • I don't expect this issue to be solved in an Office Update. I said the code is using undocumented behavior that could be broken by each and every Office Update. It is an accident that your code worked before. Don't write code that rely on this clipboard format. Remove this feature from your application.


    Visual C++ MVP



    Tuesday, April 23, 2013 1:15 PM