home *** CD-ROM | disk | FTP | other *** search
- ' Datasets are named sets of variables that can be attached to most objects
- ' Attach a dataset to the active document
-
- ' create a name for this dataset
- ' each dataset is indexed by name
- ' within each named dataset, multiple entries can be stored
-
- Dim SetName As String
- SetName = "CustomSet"
-
- Dim MyDataSet As WPDataSetCollection
-
- ' Set MyData = Object
- ' Set MyDataSet = .Frame.Layout.WPDataset ' attach dataset to current frame
- Set MyDataSet = .ActiveDocument.WPDataSets
-
- Stat = MyDataSet(SetName$).SetData("Entry1","This is data for entry1")
- Stat = MyDataSet(SetName$).SetData("Entry2","Store any text here")
-
- ' print the number of datasets attached to this document
- ' get the count for the WPDataSets collection for this object
-
- Print "Number of datasets attached to object = " MyDataSet.Count
- Print MyDataSet(SetName$).Getdata("Entry1","Default")
- Print MyDataSet(SetName$).Getdata("Entry2","Default")
-
-
- Forall CurrentSet In MyDataSet
- Print CurrentSet.Name
- End Forall
-