REM Description: Copy current page, including all frames, to next page REM WSWin Macro File: copypage.wmc REM Author: Rich Zuris [76702,520] REM Created: 3/10/95 REM Revised: 7/14/95 -- turn off autopagination to copy page 'Freeze the screen display freeze% = ViewFreezeScreen(1) 'Turn off auto-pagination, which allows you to copy the page frame ' Note: this command is undocumented ToolsAutoPagination 0 'Switch to frame mode saveMode% = ViewEditMode(2) 'Select page frame type% = GetTextFrameType() WHILE type% <> 1 AND type% <> 2 ParentFrame type% = GetTextFrameType() WEND 'Save the source page id and see if there's a following page to link to srcPage% = GetFrame(0,,) NextLinkedFrame 'EditGoto 4,,, doesn't work reliably nxtPage% = GetFrame(0,,) 'If no next page, nxtPage==srcPage EditGoto 9, srcPage%,, 'Return to source page 'Copy and paste the page and get the new page id EditCopy EditPaste 'New page is inserted after source page dstPage% = GetFrame(0,,) 'Link the new frame to the source page EditGoto 9, srcPage%,, FrameLinkFrame dstPage% EditGoto 9, dstPage%,, 'If there's a following page, link the new page to it IF srcPage% <> nxtPage% THEN FrameLinkFrame nxtPage% ENDIF 'Restore edit mode and auto-pagination and unfreeze the screen saveMode% = ViewEditMode(saveMode%) ToolsAutoPagination 1 freeze% = ViewFreezeScreen(freeze%)