home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 January / dppcpro0199a.iso / January / Fp98 / SDK / Utility / Apitests / Listdocs.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-09-18  |  4.6 KB  |  150 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmListDocs 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "List Documents in Web"
  6.    ClientHeight    =   5790
  7.    ClientLeft      =   1470
  8.    ClientTop       =   2040
  9.    ClientWidth     =   6630
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   5790
  15.    ScaleWidth      =   6630
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.CommandButton btnRefresh 
  18.       Caption         =   "Refresh"
  19.       Height          =   375
  20.       Left            =   240
  21.       TabIndex        =   3
  22.       Top             =   5280
  23.       Width           =   1095
  24.    End
  25.    Begin ComctlLib.ListView lstDocs 
  26.       Height          =   3855
  27.       Left            =   240
  28.       TabIndex        =   0
  29.       Top             =   1320
  30.       Width           =   6135
  31.       _ExtentX        =   10821
  32.       _ExtentY        =   6800
  33.       View            =   3
  34.       Sorted          =   -1  'True
  35.       MultiSelect     =   -1  'True
  36.       LabelWrap       =   -1  'True
  37.       HideSelection   =   -1  'True
  38.       _Version        =   327680
  39.       ForeColor       =   -2147483640
  40.       BackColor       =   -2147483643
  41.       BorderStyle     =   1
  42.       Appearance      =   1
  43.       MouseIcon       =   "listdocs.frx":0000
  44.       NumItems        =   2
  45.       BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  46.          Key             =   ""
  47.          Object.Tag             =   ""
  48.          Text            =   "Title"
  49.          Object.Width           =   5080
  50.       EndProperty
  51.       BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  52.          Key             =   ""
  53.          Object.Tag             =   ""
  54.          Text            =   "Page URL"
  55.          Object.Width           =   3087
  56.       EndProperty
  57.    End
  58.    Begin VB.Label Label6 
  59.       Alignment       =   2  'Center
  60.       Caption         =   "vtiGetWebURL, vtiGetPageList"
  61.       Height          =   255
  62.       Left            =   240
  63.       TabIndex        =   5
  64.       Top             =   480
  65.       Width           =   6135
  66.       WordWrap        =   -1  'True
  67.    End
  68.    Begin VB.Label Label5 
  69.       Caption         =   "This form uses the following FrontPage Explorer methods:"
  70.       Height          =   255
  71.       Left            =   240
  72.       TabIndex        =   4
  73.       Top             =   120
  74.       Width           =   6135
  75.    End
  76.    Begin VB.Line Line1 
  77.       X1              =   240
  78.       X2              =   6360
  79.       Y1              =   840
  80.       Y2              =   840
  81.    End
  82.    Begin VB.Label lblWeb 
  83.       Height          =   255
  84.       Left            =   1440
  85.       TabIndex        =   2
  86.       Top             =   1080
  87.       Width           =   4935
  88.    End
  89.    Begin VB.Label Label1 
  90.       Caption         =   "Current web:"
  91.       Height          =   255
  92.       Left            =   240
  93.       TabIndex        =   1
  94.       Top             =   1080
  95.       Width           =   1215
  96.    End
  97. Attribute VB_Name = "frmListDocs"
  98. Attribute VB_GlobalNameSpace = False
  99. Attribute VB_Creatable = False
  100. Attribute VB_PredeclaredId = True
  101. Attribute VB_Exposed = False
  102. Option Explicit
  103. Private Sub Command1_Click()
  104. End Sub
  105. Private Sub btnRefresh_Click()
  106.     MousePointer = 11
  107.     Dim pagelist As String
  108.     Dim idx As Integer
  109.     Dim newline As String
  110.     Dim title As String
  111.     Dim url As String
  112.     Dim itmX As ListItem
  113.     newline = Chr$(10)
  114.     lstDocs.ListItems.Clear
  115.     Dim webber As Object
  116.     Set webber = CreateObject("FrontPage.Explorer")
  117.     lblWeb = webber.vtiGetWebURL
  118.     pagelist = webber.vtiGetPageList(0)
  119.     While Len(pagelist) > 0
  120.         
  121.         idx = InStr(pagelist, newline)
  122.         If idx > 0 Then
  123.             title = Left$(pagelist, idx - 1)
  124.             pagelist = Mid$(pagelist, idx + 1)
  125.         Else
  126.             title = pagelist
  127.         End If
  128.         
  129.         idx = InStr(pagelist, newline)
  130.         If idx > 0 Then
  131.             url = Left$(pagelist, idx - 1)
  132.             pagelist = Mid$(pagelist, idx + 1)
  133.         Else
  134.             url = pagelist
  135.         End If
  136.         
  137.         Set itmX = lstDocs.ListItems.Add(, , title)
  138.         itmX.SubItems(1) = url
  139.         
  140.     Wend
  141.     Set webber = Nothing
  142.     MousePointer = 0
  143. End Sub
  144. Private Sub Form_Load()
  145.     btnRefresh_Click
  146. End Sub
  147. Private Sub lstDocs_ColumnClick(ByVal ColumnHeader As ColumnHeader)
  148.     lstDocs.SortKey = ColumnHeader.Index - 1
  149. End Sub
  150.