none
How to retain destination formatting while pasting content in PowerPoint? RRS feed

  • Question

  • Hi,

    Is there a way I can retain my destination formatting of PowerPoint when I copy paste it from Word.

    I am using the below code to do that.

    currSlide.Shapes[2].TextFrame.TextRange.PasteSpecial(PowerPoint.PpPasteDataType.ppPasteHTML, Microsoft.Office.Core.MsoTriState.msoFalse, string.Empty, 0, string.Empty, Microsoft.Office.Core.MsoTriState.msoFalse); 

    But it always take the source formatting and it doesn't look good in PowerPoint. I use PowerPoint.PpPasteDataType.ppPasteHTML because I need to keep the Bold, Italic and Underline.

    Thanks


    Thanks a lot. Sree
    Thursday, September 15, 2011 1:41 PM

All replies

  • Hi Sree,

     

    Thanks for posting in the MSDN Forum.

     

    I try to reproduce your issue on my side. I found the Bold, Italic and Underline will be keep when I paste the content which I copy from Word document. Would you please provide more details for you goal? Such as PowerPoint’s version, the shape you will paste content. It will make more sense to show more snippets about your goal to do further research.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, September 19, 2011 3:56 AM
    Moderator
  • Hi Tom,

    Thanks for the response. You are right, using the above snippet is keeping Bold, Italic and Underline. But it keeps the other source formatting as space between paragraphs and all. I want to restrict those things from appearing on the slide. If I use any other data type other than PowerPoint.PpPasteDataType, i will lose the Bold, Italic and Underline. By using PowerPoint.PpPasteDataType option, can I still apply the pragraph spacing of the destination (PowerPoint)?

    I am using Office 2007 32-bit.

    Thanks.


    Thanks a lot. Sree
    Tuesday, September 20, 2011 12:38 PM
  • Hi Sree,

     

    It’s based on my experience that we are hard to approach your goal.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, September 27, 2011 8:05 AM
    Moderator