home *** CD-ROM | disk | FTP | other *** search
- 'Automation example
- 'This script does find on the field itemno
- 'for values less than 10. Then it stores
- 'the values statically in a new WordPro
- 'document.
-
- Dim RowCount As Integer
-
- Set MyFind = New Find("itemno", "< 10")
- CurrentDocument.window.FindSort MyFind
-
- RowCount = CurrentDocument.Window.NumRecordsFound
-
- 'Create a new instance of the WordPro application
- Set WordPro = CreateObject("WordPro.Application")
-
- 'With is used as shorthand for the WordPro object created
- With WordPro
- 'Make WordPro visible
- .visible = True
- 'Create a new WordPro document
- .newdocument
- ' create table with one extra row for headings
- .CreateTable False,"Default Table",5, RowCount + 1
- 'First print the column headings:
- .type "Item No"
- 'The following line tabs to the next cell
- Call .table.gototablecell(117,1)
- .type "Item"
- Call .table.gototablecell(117,1)
- .type "Description"
- Call .table.gototablecell(117,1)
- .type "Date of Purchase"
- Call .table.gototablecell(117,1)
- .type "Value"
- Call .table.gototablecell(117,1)
- 'Now type the values:
- 'Go to the first record
- CurrentDocument.Window.FirstRecord
- For c=0 To RowCount
- 'These objects happen to be in
- 'the correct order to match
- 'the columns headings
- Forall objects In CurrentView.ObjectList
- 'Check the object type before printing
- If objects.Type = $APRFIELDBOX Then
- .type objects.Text
- Call .table.gototablecell(117,1)
- End If
- End Forall
- 'Go to the next record
- CurrentDocument.Window.NextRecord
- Next
-
- End With
-