private static string AppendSlide(PresentationPart presentationPart, SlidePart newSlidePart) { //MMS:3 //get slides id list SlideIdList slideIdList = presentationPart.Presentation.SlideIdList; // find the highest id uint maxSlideId = slideIdList.ChildElements .Cast <SlideId>() .Max(x => x.Id.Value); //create new slide id based on max id uint newId = maxSlideId + 1; //add new slide id item at the second place in the list SlideId newSlideId = new SlideId(); slideIdList.InsertAt(newSlideId, 1); newSlideId.Id = newId; newSlideId.RelationshipId = presentationPart.GetIdOfPart(newSlidePart); //newSlideId.RelationshipId.Value = "rId2"; return(newSlideId.RelationshipId); }