Click here to Skip to main content
16,013,548 members
Home / Discussions / C#
   

C#

 
QuestionDetect the USB device by logical disk name? Pin
delemur28-Mar-05 1:24
delemur28-Mar-05 1:24 
GeneralC# code generation tool Pin
Rizal Alwin28-Mar-05 1:10
sussRizal Alwin28-Mar-05 1:10 
GeneralRe: C# code generation tool Pin
Dave Kreskowiak28-Mar-05 5:26
mveDave Kreskowiak28-Mar-05 5:26 
GeneralVB to C# Pin
abandito28-Mar-05 0:53
abandito28-Mar-05 0:53 
GeneralRe: VB to C# Pin
DavidNohejl28-Mar-05 1:02
DavidNohejl28-Mar-05 1:02 
GeneralRe: VB to C# Pin
abandito28-Mar-05 1:13
abandito28-Mar-05 1:13 
GeneralRe: VB to C# Pin
DavidNohejl28-Mar-05 1:22
DavidNohejl28-Mar-05 1:22 
GeneralRe: VB to C# Pin
abandito28-Mar-05 1:36
abandito28-Mar-05 1:36 
Here is a function to copy from a presentation all elements and make a new presentation of it.
For each element of a shape a new shape is generated.
But the problem is that it loses all its formatting for the text, background,...
Perhaps anybody has an idea.
Thanks a lot!

Code:

public PowerPoint.Presentation GetPresentation(PowerPoint.Presentation pOriginalPresWithAnimations) {

PowerPoint.Presentation pNewPresWithoutAnimations = __pPPT.Presentations.Add(Office.MsoTriState.msoTrue);

string sName = pOriginalPresWithAnimations.Name;
string sPPTCopyPath = "PresentationCopy";

string sPath = System.Windows.Forms.Application.ExecutablePath;

sPath = Path.GetDirectoryName(sPath);

sPPTCopyPath = Path.Combine(sPath, sPPTCopyPath);

string sSlidePathName = Path.Combine(sPPTCopyPath, sName);

if(!Directory.Exists(sPPTCopyPath))
Directory.CreateDirectory(sPPTCopyPath);
if (File.Exists(sSlidePathName))
File.Delete(sSlidePathName);



pNewPresWithoutAnimations.SaveAs(sSlidePathName, PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, Office.MsoTriState.msoTrue);


foreach (PowerPoint.Slide pSlide in pOriginalPresWithAnimations.Slides) {

SlideInfo pSlideInfo = PresentationInfo.GetInfos(pSlide);

ArrayList pArrayFix = new ArrayList();
Hashtable pHashAnimiert = new Hashtable();

for (int i = 1; i <= pSlide.Shapes.Count; i++) {
__pShape = pSlide.Shapes.Item(i);

if (__pShape.AnimationSettings.Animate == Office.MsoTriState.msoFalse) {
pArrayFix.Add(__pShape);
}
else {
pHashAnimiert.Add(__pShape.AnimationSettings.AnimationOrder - 1, __pShape);

}
}

__pSlide = pNewPresWithoutAnimations.Slides.Add(__nFolienIndex, pSlide.Layout);

for (int j = 0; j < pArrayFix.Count; j++) {
__pShape = (PowerPoint.Shape)pArrayFix[j];
__pShape.Copy();
__pSlide.Shapes.Paste();
}
AddAllSlides(pSlideInfo, new SlideInfo());

for (int i = 0; i < pHashAnimiert.Count; i++) {
__pSlide = pNewPresWithoutAnimations.Slides.Add(__nFolienIndex, pSlide.Layout);
__pShape = (PowerPoint.Shape)pHashAnimiert[i];
__pShape.Copy();
__pSlide.Shapes.Paste();
if (i >= 1) {
for (int k = 0; k < i; k++) {
__pShape = (PowerPoint.Shape)pHashAnimiert[k];
__pShape.Copy();
__pSlide.Shapes.Paste();
}
}
AddAllSlides(pSlideInfo, new SlideInfo());
}
}
__nFolienIndex = 1;
return pNewPresWithoutAnimations;
Generalequivalaent of the delphi WITH statement Pin
sephless28-Mar-05 0:46
sephless28-Mar-05 0:46 
GeneralRe: equivalaent of the delphi WITH statement Pin
Wraith228-Mar-05 1:02
Wraith228-Mar-05 1:02 
GeneralRe: equivalaent of the delphi WITH statement Pin
DavidNohejl28-Mar-05 1:07
DavidNohejl28-Mar-05 1:07 
GeneralRe: equivalaent of the delphi WITH statement Pin
Dave Doknjas28-Mar-05 8:27
Dave Doknjas28-Mar-05 8:27 
Generalrequired selected color dropout logic Pin
montu337728-Mar-05 0:10
montu337728-Mar-05 0:10 
GeneralMultiple files class Pin
danidanidani27-Mar-05 23:26
danidanidani27-Mar-05 23:26 
GeneralRe: Multiple files class Pin
matthias s.28-Mar-05 0:48
matthias s.28-Mar-05 0:48 
GeneralRe: Multiple files class Pin
danidanidani28-Mar-05 0:58
danidanidani28-Mar-05 0:58 
QuestionHow to change system time? Pin
pmasknguyen27-Mar-05 23:04
pmasknguyen27-Mar-05 23:04 
AnswerRe: How to change system time? Pin
JockerSoft28-Mar-05 0:37
JockerSoft28-Mar-05 0:37 
QuestionHow do we print one line at a time? Pin
WillStay27-Mar-05 22:43
WillStay27-Mar-05 22:43 
AnswerRe: How do we print one line at a time? Pin
Dave Kreskowiak28-Mar-05 5:25
mveDave Kreskowiak28-Mar-05 5:25 
GeneralRe: How do we print one line at a time? Pin
Anonymous28-Mar-05 6:21
Anonymous28-Mar-05 6:21 
GeneralRe: How do we print one line at a time? Pin
Dave Kreskowiak29-Mar-05 1:41
mveDave Kreskowiak29-Mar-05 1:41 
GeneralVALIDATING TEXT BOX DOES NOT WORK Pin
maheshfour27-Mar-05 22:42
maheshfour27-Mar-05 22:42 
GeneralRe: VALIDATING TEXT BOX DOES NOT WORK Pin
Darryl Borden28-Mar-05 10:12
Darryl Borden28-Mar-05 10:12 
GeneralRe: VALIDATING TEXT BOX DOES NOT WORK Pin
ameto31-Mar-05 23:09
ameto31-Mar-05 23:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.