private void RegulatePresentationName(PowerPoint.Presentation pres, string tempPath, ref string presName, ref string presFullName) { // this function is used to handle "embed on other application" issue. In this case, // all of presentation name, path and full name do not match the usual rule: name is // "Untitled", path is empty string and full name is "slide in XX application". We need // to regulate these fields properly. if (!presName.Contains(".pptx")) { presName += ".pptx"; } if (tempPath != null) { // every time when recorder pane is open, // save this presentation's copy, which will be used // to load audio files later pres.SaveCopyAs(tempPath + presName); presFullName = tempPath + presName; } }
private void RegulatePresentationName(PowerPoint.Presentation pres, string tempPath, ref string presName, ref string presFullName) { // this function is used to handle "embed on other application" issue. In this case, // all of presentation name, path and full name do not match the usual rule: name is // "Untitled", path is empty string and full name is "slide in XX application". We need // to regulate these fields properly. if (!presName.Contains(".pptx")) { presName += ".pptx"; } PowerPoint.DocumentWindow associatedWindow; try { associatedWindow = pres.Windows[1]; } catch (Exception) { associatedWindow = null; } if (associatedWindow != null && _documentPathAssociateMapper.ContainsKey(associatedWindow) && _documentPathAssociateMapper[associatedWindow] && !string.IsNullOrEmpty(tempPath)) { pres.SaveCopyAs(tempPath + presName); presFullName = tempPath + presName; } }