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

  1. VERSION 5.00
  2. Begin VB.Form frmCreate 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Create/Remove Web"
  5.    ClientHeight    =   5100
  6.    ClientLeft      =   1845
  7.    ClientTop       =   2910
  8.    ClientWidth     =   5325
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   5100
  14.    ScaleWidth      =   5325
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.CommandButton btnRemove 
  17.       Caption         =   "Remove Web"
  18.       Enabled         =   0   'False
  19.       Height          =   375
  20.       Left            =   1680
  21.       TabIndex        =   3
  22.       Top             =   3000
  23.       Width           =   1335
  24.    End
  25.    Begin VB.CommandButton btnCreate 
  26.       Caption         =   "Create Web"
  27.       Height          =   375
  28.       Left            =   240
  29.       TabIndex        =   2
  30.       Top             =   3000
  31.       Width           =   1335
  32.    End
  33.    Begin VB.TextBox txtServer 
  34.       Height          =   285
  35.       Left            =   240
  36.       TabIndex        =   0
  37.       Top             =   1320
  38.       Width           =   4935
  39.    End
  40.    Begin VB.TextBox txtWeb 
  41.       Height          =   285
  42.       Left            =   240
  43.       TabIndex        =   1
  44.       Top             =   2280
  45.       Width           =   4935
  46.    End
  47.    Begin VB.CheckBox optCanRemove 
  48.       Caption         =   "Enable Remove Web"
  49.       Height          =   255
  50.       Left            =   240
  51.       TabIndex        =   4
  52.       Top             =   3600
  53.       Width           =   2055
  54.    End
  55.    Begin VB.Label lblServer 
  56.       Caption         =   "Web Server:"
  57.       Height          =   195
  58.       Left            =   240
  59.       TabIndex        =   11
  60.       Top             =   1080
  61.       Width           =   1815
  62.    End
  63.    Begin VB.Label Label2 
  64.       Caption         =   "Web Name:"
  65.       Height          =   195
  66.       Left            =   240
  67.       TabIndex        =   10
  68.       Top             =   2040
  69.       Width           =   1815
  70.    End
  71.    Begin VB.Label lblServerHelp 
  72.       Caption         =   "(the TCP/IP host name or address of the web server machine)"
  73.       Height          =   255
  74.       Left            =   240
  75.       TabIndex        =   9
  76.       Top             =   1680
  77.       Width           =   4935
  78.    End
  79.    Begin VB.Label Label7 
  80.       Caption         =   "(the name of the FrontPage web, or nothing for the Root Web)"
  81.       Height          =   255
  82.       Left            =   240
  83.       TabIndex        =   8
  84.       Top             =   2640
  85.       Width           =   4935
  86.    End
  87.    Begin VB.Line Line2 
  88.       X1              =   240
  89.       X2              =   5160
  90.       Y1              =   4080
  91.       Y2              =   4080
  92.    End
  93.    Begin VB.Label Label1 
  94.       Caption         =   $"create.frx":0000
  95.       Height          =   675
  96.       Left            =   240
  97.       TabIndex        =   7
  98.       Top             =   4320
  99.       Width           =   4935
  100.       WordWrap        =   -1  'True
  101.    End
  102.    Begin VB.Label Label5 
  103.       Caption         =   "This form uses the following FrontPage Explorer methods:"
  104.       Height          =   255
  105.       Left            =   240
  106.       TabIndex        =   6
  107.       Top             =   120
  108.       Width           =   4815
  109.    End
  110.    Begin VB.Label Label6 
  111.       Alignment       =   2  'Center
  112.       Caption         =   "vtiCreateWeb, vtiRemoveWeb"
  113.       Height          =   255
  114.       Left            =   240
  115.       TabIndex        =   5
  116.       Top             =   480
  117.       Width           =   4815
  118.       WordWrap        =   -1  'True
  119.    End
  120.    Begin VB.Line Line1 
  121.       X1              =   240
  122.       X2              =   5160
  123.       Y1              =   840
  124.       Y2              =   840
  125.    End
  126. Attribute VB_Name = "frmCreate"
  127. Attribute VB_GlobalNameSpace = False
  128. Attribute VB_Creatable = False
  129. Attribute VB_PredeclaredId = True
  130. Attribute VB_Exposed = False
  131. Option Explicit
  132. Private Sub btnCreate_Click()
  133.     MousePointer = 11
  134.     Dim webber As Object
  135.     Dim ret As Long
  136.     Set webber = CreateObject("FrontPage.Explorer")
  137.     ret = webber.vtiCreateWeb(txtServer, txtWeb)
  138.     Set webber = Nothing
  139.     MousePointer = 0
  140. End Sub
  141. Private Sub Command2_Click()
  142. End Sub
  143. Private Sub btnRemove_Click()
  144.     MousePointer = 11
  145.     Dim webber As Object
  146.     Dim ret As Long
  147.     Dim webURL As String
  148.     Set webber = CreateObject("FrontPage.Explorer")
  149.     webURL = webber.vtiGetWebURL
  150.     If Len(webURL) > 0 Then
  151.         ret = webber.vtiRemoveWeb("/" & txtWeb)
  152.         If ret <> 1 Then
  153.             MsgBox "Unable to remove the web '" & txtWeb & "'; it may not exist on the server."
  154.         End If
  155.     Else
  156.         MsgBox "There must be an open web in the Explorer for vtiRemoveWeb to work."
  157.     End If
  158.     Set webber = Nothing
  159.     MousePointer = 0
  160. End Sub
  161. Private Sub optCanRemove_Click()
  162.     Dim yesno As Boolean
  163.     yesno = optCanRemove.Value
  164.     btnRemove.Enabled = yesno
  165.     lblServer.Enabled = Not yesno
  166.     lblServerHelp.Enabled = Not yesno
  167.     txtServer.Enabled = Not yesno
  168. End Sub
  169.