home *** CD-ROM | disk | FTP | other *** search
- ' The Present-It Script
- ' Copies selected text from the current document to the clipboard,
- ' launches Freelance, and creates presentation content from the
- ' text on the clipboard.
-
- Sub PrsIt()
- On Error Goto HandleProblem
- ' Use these flags to detect the most common errors.
- NullSelectionFailure = False
- LaunchFailure = False
-
- 'Save previous view info
- IsPrevViewOutline = CurrentWindow.WinViewPrefs.IsInOutline
- ' Show outline, if not already showing
- If IsPrevViewOutline = False Then
- .BeginChange True
- CurrentWindow.WinViewPrefs.IsInOutline = True
- .EndChange True
- End If
- ' Copy to clipboard
- NullSelectionFailure = True
- .CopySelection
- NullSelectionFailure = False
-
-
- ' Fire up Freelance
- LaunchFailure = True
- Set FLG = CreateObject("Freelance.Application.96")
- LaunchFailure = False
- Set Doc = FLG.NewDocument()
- ' Otherwise the new presentation will be inaccessible
- FLG.Visible = True
- ' Go to the Freelance outline view
- Doc.ViewMode = FLG.GetEnum("ViewOutliner")
- ' Paste in the WP doc
- Doc.Paste
- ' Go to the Freelance sorter view
- Doc.ViewMode = FLG.GetEnum("ViewSorter")
- PageCount = Doc.Pages.Count
- If PageCount = 1 Then
- ' Nothing pasted?
- ' Print "debug: no pages created"
- Else
- ' Last page is the empty title page - get rid of it.
- Set LastPage = Doc.Pages.Item(PageCount)
- LastPage.Remove
- End If
- ' Return to draw view
- Doc.ViewMode = FLG.GetEnum("ViewDraw")
- ' Leave Freelance running with new document active.
- goto AllIsWell
-
- HandleProblem:
- On Error Goto VeryEnd
- If NullSelectionFailure = False Then
- If LaunchFailure = False Then
- MessageBox error$(), 48, "Error Creating Presentation"
- Else
- MessageBox "Lotus Freelance Graphics 96 must be installed before running this procedure.", 48, "Error Creating Presentation"
- End If
- Else
- MessageBox "Please select the text you wish to use before running this procedure.", 48, "Error Creating Presentation"
- End If
- Resume Out
-
- AllIsWell:
- ' Print "Completed successfully."
-
- Out:
- ' Restore view if not outline
- If IsPrevViewOutline = False Then
- .BeginChange True
- CurrentWindow.WinViewPrefs.IsInOutline = False
- .EndChange True
- End If
- VeryEnd:
-
- End Sub 'PRSIT
-
- Sub Main
- Call PrsIt
- End Sub
-