.. highlightlang:: us .. index:: PageSendToPowerPoint .. _pagesendtopowerpoint: PageSendToPowerPoint ==================== .. us.tag PageSendToPowerPoint ENGLISH New5700 PageSet :ref:`PageSendToPowerPoint` creates a PowerPoint document from the given pages. This function uses the COM interface. PowerPoint must be installed. .. function:: bool = PageSendToPowerPoint(hvPage, ssTemplate, ssSaveName, bAppend, bClose) .. us.return **Return Value** *bool* TRUE (1) if the file is created successfully; otherwise FALSE (0). .. us.params **Parameters** .. uparam:: hvPage Vector with page handles. .. uparam:: ssTemplate *ssTemplate* is the name of a PowerPoint template file. See :ref:`file-send-to-powerpoint`. If an empty string is used, not template will be used. .. uparam:: ssSaveName Is the name for the PowerPoint file. .. uparam:: bAppend If TRUE (1) and a PowerPoint file with the Name *ssSaveName* already exists, the given pages will be added to the PowerPoint document. Otherwise the PowerPoint file will be replaced. .. uparam:: bClose If *bClose* is TRUE (1), the open PowerPoint document will be closed. .. us.example **Example** :: // Select UniPlot document and export to PowerPoint RegisterCommand("File", "MyPPExport", "Export IPW/IPZ to Powerpoint"); UserBar_Add("MyPPExport"); def MyPPExport() { ssFilter = _s("UniPlot Files (*.ipw;*.ipz) |*.ipw;*.ipz|All (*.*) |*.*|"); svFile = GetOpenFileName("", ssFilter, 1, 1); if (svFile[1] == "") { return; } ssTemplate = ""; ssUseTemplate = GetProfileString("settings", "PowerPointTemplate_use"); if (ssUseTemplate == "1") { ssTemplate = GetProfileString("settings", "PowerPointTemplate"); ssTemplate = MakeFullPath(ssTemplate); } bAppend = FALSE; bClose = TRUE; bBoundingBox = (GetProfileInt("settings", "PowerPoint_UseBoundingBox", "", 1) == 1); nFiles = len(svFile); for (iFile in 1:nFiles) { hDoc = _DocIsOpen(svFile[iFile]); if (hDoc != 0) { log_warning("", "Ignore open file", "Please close all IPW/IPZ files"); // ignore open files continue; } hDoc = DocCreate(svFile[iFile]); if (hDoc == 0) { log_error("", svFile[iFile], "Cannot open file"); continue; } hvPage = DocGetAllPages(hDoc); for (i in 1:len(hvPage)) { if (PageGetAttrib(hvPage[i]) == 1) { // remove pages with do not print attribute hvPage[i] = 0; } } hvPage = remove(hvPage); svPath = SplitPath(svFile[iFile]); ssSaveName = sum(svPath[1:3]) + ".pptx"; PageSendToPowerPoint(hvPage, ssTemplate, ssSaveName, bAppend, bClose, bBoundingBox); DocDestroy(hDoc); } } .. seealso:: :ref:`overview-document-pages`, :ref:`PageSaveAsMetafile`, :ref:`PageSaveAsBitmapEx`, :ref:`file-send-to-powerpoint` :sub:`id-551`