home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pegasus 5
/
Pegasus_Vol_5_CD2.iso
/
lotus
/
lotus033.dsk
/
PRSIT.LSS
< prev
next >
Wrap
Text File
|
1995-11-28
|
2KB
|
84 lines
' 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, "Fehler beim Erstellen der PrΣsentation"
Else
MessageBox "Bitte markieren Sie den Text, den Sie verwenden wollen, bevor Sie die Prozedur starten.", 48, "Fehler beim Erstellen der PrΣsentation"
End If
Else
MessageBox "Freelance Graphics 96 mu▀ installiert werden, bevor Sie diese Prozedur ausfⁿhren k÷nnen.", 48, "Fehler beim Erstellen der PrΣsentation"
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