private static ShapeRange PasteWithCorrectSlideCheck(PowerPointSlide slide, bool isPasteSpecial = false, PpPasteDataType pasteType = PpPasteDataType.ppPasteDefault) { // Note: Some copied objects are pasted on currentSlide rather than the desired slide (e.g. jpg from desktop), // so we must check whether it is pasted correctly, else we cut-and-paste it into the correct slide. int initialSlideShapesCount = slide.Shapes.Count; ShapeRange pastedShapes = null; if (!isPasteSpecial) { pastedShapes = slide.Shapes.Paste(); } else { pastedShapes = slide.Shapes.PasteSpecial(pasteType); } int finalSlideShapesCount = slide.Shapes.Count; if (pastedShapes.Count >= 1 && finalSlideShapesCount == initialSlideShapesCount) { pastedShapes.Cut(); if (!isPasteSpecial) { pastedShapes = slide.Shapes.Paste(); } else { pastedShapes = slide.Shapes.PasteSpecial(pasteType); } } return(pastedShapes); }
public ShapeRange PasteSpecial(PpPasteDataType DataType = PpPasteDataType.ppPasteDefault, Microsoft.Office.Core.MsoTriState DisplayAsIcon = Microsoft.Office.Core.MsoTriState.msoFalse, string IconFileName = "", int IconIndex = 0, string IconLabel = "", Microsoft.Office.Core.MsoTriState Link = Microsoft.Office.Core.MsoTriState.msoFalse) { throw new NotImplementedException(); }