home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 November
/
pcwk_11_98B.iso
/
Lotus
/
FRENCH
/
LOTUS025.DSK
/
SCRIPTS
/
PRSIT.LSS
< prev
Wrap
Text File
|
1997-03-06
|
2KB
|
83 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")
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.ActivePage.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 = True Then
MessageBox "SΘlectionnez le texte α utiliser avant d'exΘcuter cette procΘdure.", 48, "Erreur de crΘation de prΘsentation"
Else
If LaunchFailure = True Then
MessageBox "Lotus Freelance Graphics 97 doit Ωtre installΘ avant d'exΘcuter cette procΘdure.", 48, "Erreur de crΘation de prΘsentation"
End If
End If
Resume Out
AllIsWell:
' Print "ProcΘdure terminΘe avec succΦs."
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