home *** CD-ROM | disk | FTP | other *** search
- ' This script fills a bulleted list with predefined text.
- ' It consists of three subs: SetAgenda (the primary
- ' sub), SampleAgendaPlan, and Main. The sub Main is used
- ' so that this script can be attached to an icon
- ' as well as an event.
- ' The code for all three subs follows one after the other.
-
- ' Declare globals
- ' Declare a constant containing the text that will be
- ' used to fill the bulleted list. The text contains the
- ' markup sequence <= for carriage return.
-
- Const SampleAgendaTxt = "First bullet<=" + _
- "Second bullet<=Third bullet<=Fourth " + _
- "bullet<=Fifth bullet"
-
-
-
- ' The following sub, SetAgenda, is scripted with the
- ' assumption that there is only one placement block
- ' on the page and that it will be turned into a
- ' text block.
- Private Sub SetAgenda(TextToInsert As String)
- Dim AgendaTxtBlk As DrawObject
- Dim DummyTextBlk As DrawObject
- ' Using a ForAll and an If statement, search the
- ' current page for a placement block.
- Forall Objs In CurrentPage.Objects
- If (Objs.IsPlacementBlock) Then
- ' The variable, AgendaTxtBlk, is set to be
- ' the instance of the PlacementBlock class
- ' found on the current page.
- Set AgendaTxtBlk = Objs
- End If
- End Forall
- ' Create a temporary text block
- Set DummyTextBlk = _
- CurrentPage.CreateText(1000,1000,1000,1000)
- ' Enter text in the temporary text block using
- ' the Text property of the TextBlock class. TextBlock is
- ' also a property of the DrawObject class. It is
- ' simpler to move a text block into a placement
- ' block than it is to move a string of text into a
- ' placement block, so this script uses this method of
- ' manipulating text.
- DummyTextBlk.TextBlock.Text = "temp"
- ' Put the temporary text into the placement block using
- ' the Insert method of the PlacementBlock class.
- AgendaTxtBlk.Insert DummyTextBlk
- Forall Object In CurrentPage.Objects
- ' Check each text string t to see which is the
- ' one with the text "temp" in it. When you find it,
- ' put the text you want to insert into it.
- If (Object.TextBlock.Text = "temp") Then
- Object.TextBlock.Text = TextToInsert
- Object.TextBlock.BulletProperties.Style = $ltsBulletLargeDot
- Exit Forall
- End If
- End Forall
- End Sub
- ' This sub, SampleAgendaPlan, calls the sub SetAgenda
- ' with the text constant, SampleAgendaTxt.
- Sub SampleAgendaPlan()
- SetAgenda(SampleAgendaTxt)
- End Sub
- ' This sub, Main, calls SampleAgendaPlan. When you use
- ' sub Main, the sub is generically available
- ' in Freelance Graphics, so that you
- ' can run the sub even when it is not attached to an
- ' event. It can, for example, be attached to an icon.
- Sub Main
- SampleAgendaPlan
- End Sub
-