home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / frntpage.sdk / utility / apitests / create.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-05-31  |  5.1 KB  |  170 lines

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