home *** CD-ROM | disk | FTP | other *** search
- ' This example contains two examples, one
- ' opens the clip art browser, the other, a variation
- ' on the first, opens the diagram browser.
-
-
- ' Script to launch clip art browser with a
- ' specified clip art file.
- ' This script consists of two subs. The first is
- ' LaunchSymBrowser, the primary sub that actually
- ' opens the clip art browser. The second
- ' sub is the sub that calls LaunchSymBrowser with a parameter
- ' indicating whether the sub should open the clip art
- ' browser.
- ' There are two complete examples each
- ' containing two subs. One example opens the clip art,
- ' browser, the other opens the diagram browser.
- ' Once the browser is open, the user
- ' selects which item to place on the page.
- ' The sub, LaunchSymBrowser, looks for an existing
- ' placement block (a SymbolPlacementBlock in this case)
- ' on the current page and then opens the
- ' clip art browser so that the user can select clip art
- ' for that placement block.
- Private Sub LaunchSymBrowser(SymbolFile As String)
- Dim SymPB As DrawObject
- ' The following line locates the placement block named
- ' SymbolPlacementBlock1 on the current page and
- ' then assigns it to the object variable, SymPB.
- ' To do this, you have to know the name of
- ' the placement block.
- Set SymPB = _
- CurrentPage.FindObject("SymbolPlacementBlock1")
- ' The next line uses the BrowseSymbols method of the
- ' PlacementBlock class to open the symbol browser
- ' with the name of the clip art file that
- ' has been passed to this sub. Note the use of
- ' the TemplateDir property to indicate the path of
- ' the file.
- SymPB.PlacementBlock.BrowseSymbols CurrentApplication._
- Preferences.TemplateDir + SymbolFile
- ' Note: you could write a variation on this sub that first
- ' creates the placement block, positions it on the page,
- ' and then opens the symbol browser.
- End Sub
- ' The following sub, PeopleSymbol, calls the
- ' LanuchSymBrowser sub with the name of the clip art file
- ' that it will use.
- Sub PeopleSymbol()
- LaunchSymBrowser("people.sym")
- End Sub
- ' Launching the diagram browser
- ' The following sub, LaunchDgmBrowser, does the same thing as was ' described in the previous example. However, in this case, the
- ' sub opens the diagram browser.
- ' The sub, LaunchDgmBrowser, looks for an existing diagram
- ' placement block on the current page, then opens the diagram
- ' browser so that the user's selection will go into that
- ' placement block.
- Private Sub LaunchDgmBrowser(DiagramFile As String)
- Dim DgmPB As DrawObject
- Set DgmPB = _
- CurrentPage.FindObject("DiagramPlacementBlock1")
- ' The next line uses the BrowseDiagrams method of the
- ' PlacementBlock class to open the diagram browser.
- DgmPB.PlacementBlock.BrowseDiagrams CurrentApplication. _
- Preferences.TemplateDir + DiagramFile
- End Sub
- ' The following sub, GanttDiagram, calls the
- ' LaunchDgmBrowser sub with the name of the file that
- ' contains the diagram that is used in this example.
- Sub GanttDiagram()
- LaunchDgmBrowser("gantt.dgm")
- End Sub
-