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

  1. VERSION 5.00
  2. Begin VB.Form frmMisc 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Miscellaneous Methods"
  5.    ClientHeight    =   5415
  6.    ClientLeft      =   2265
  7.    ClientTop       =   2220
  8.    ClientWidth     =   5160
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   5415
  14.    ScaleWidth      =   5160
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.CommandButton btnEditPage 
  17.       Caption         =   "Edit Web Page"
  18.       Height          =   375
  19.       Left            =   1440
  20.       TabIndex        =   8
  21.       Top             =   4380
  22.       Width           =   2055
  23.    End
  24.    Begin VB.CommandButton btnRefresh 
  25.       Caption         =   "Refresh Explorer's Views"
  26.       Height          =   375
  27.       Left            =   1440
  28.       TabIndex        =   6
  29.       Top             =   3300
  30.       Width           =   2055
  31.    End
  32.    Begin VB.CommandButton btnCancel 
  33.       Caption         =   "Cancel Pending Requests"
  34.       Height          =   375
  35.       Left            =   1440
  36.       TabIndex        =   1
  37.       Top             =   2220
  38.       Width           =   2055
  39.    End
  40.    Begin VB.CommandButton btnTop 
  41.       Caption         =   "Bring Explorer to Top"
  42.       Height          =   375
  43.       Left            =   1440
  44.       TabIndex        =   0
  45.       Top             =   1140
  46.       Width           =   2055
  47.    End
  48.    Begin VB.Label Label4 
  49.       Caption         =   "Note: this will let you select a page from the current web and open it in the appropriate editor."
  50.       Height          =   495
  51.       Left            =   240
  52.       TabIndex        =   9
  53.       Top             =   4800
  54.       Width           =   4815
  55.       WordWrap        =   -1  'True
  56.    End
  57.    Begin VB.Label Label3 
  58.       Caption         =   "Note: this will update the Explorer's internal tables about the web and its documents in addition to its graphical views."
  59.       Height          =   495
  60.       Left            =   240
  61.       TabIndex        =   7
  62.       Top             =   3780
  63.       Width           =   4815
  64.       WordWrap        =   -1  'True
  65.    End
  66.    Begin VB.Label Label2 
  67.       Caption         =   "Note: this will cancel current Explorer operations, such as opening a web or fetching a file from the web"
  68.       Height          =   495
  69.       Left            =   240
  70.       TabIndex        =   5
  71.       Top             =   2700
  72.       Width           =   4815
  73.       WordWrap        =   -1  'True
  74.    End
  75.    Begin VB.Label Label1 
  76.       Caption         =   "Note: if the Explorer is iconified, you will need to call vtiBringToTop twice to bring its window all the way to the foreground"
  77.       Height          =   495
  78.       Left            =   240
  79.       TabIndex        =   4
  80.       Top             =   1620
  81.       Width           =   4815
  82.       WordWrap        =   -1  'True
  83.    End
  84.    Begin VB.Line Line1 
  85.       X1              =   120
  86.       X2              =   5040
  87.       Y1              =   1020
  88.       Y2              =   1020
  89.    End
  90.    Begin VB.Label Label6 
  91.       Alignment       =   2  'Center
  92.       Caption         =   "vtiBringToTop, vtiCancelRequests, vtiRefreshWebFromServer, vtiEditWebPage"
  93.       Height          =   435
  94.       Left            =   120
  95.       TabIndex        =   3
  96.       Top             =   480
  97.       Width           =   4815
  98.       WordWrap        =   -1  'True
  99.    End
  100.    Begin VB.Label Label5 
  101.       Caption         =   "This form uses the following FrontPage Explorer methods:"
  102.       Height          =   255
  103.       Left            =   120
  104.       TabIndex        =   2
  105.       Top             =   120
  106.       Width           =   4815
  107.    End
  108. Attribute VB_Name = "frmMisc"
  109. Attribute VB_GlobalNameSpace = False
  110. Attribute VB_Creatable = False
  111. Attribute VB_PredeclaredId = True
  112. Attribute VB_Exposed = False
  113. Option Explicit
  114. Private Sub Command1_Click()
  115. End Sub
  116. Private Sub btnCancel_Click()
  117.     MousePointer = 11
  118.     Dim webber As Object
  119.     Set webber = CreateObject("FrontPage.Explorer")
  120.     webber.vtiCancelRequests
  121.     Set webber = Nothing
  122.     MousePointer = 0
  123. End Sub
  124. Private Sub btnEditPage_Click()
  125.     MousePointer = 11
  126.     Dim webber As Object
  127.     Dim webURL As String
  128.     Dim ret As Long
  129.     ' see if web is open
  130.     Set webber = CreateObject("FrontPage.Explorer")
  131.        
  132.     webURL = webber.vtiGetWebURL
  133.          
  134.     If Len(webURL) = 0 Then
  135.         MsgBox "There is no open web in the Explorer."
  136.     Else
  137.         frmGetURL.Tag = ""
  138.         frmGetURL.optHTML = True ' default is an HTML page
  139.         
  140.         frmGetURL.Show 1
  141.         If frmGetURL.Tag <> "" Then
  142.             ret = webber.vtiEditWebPage(frmGetURL.Tag)
  143.         End If
  144.         
  145.         frmGetURL.Tag = ""
  146.     End If
  147.     MousePointer = 0
  148.     Set webber = Nothing
  149. End Sub
  150. Private Sub btnRefresh_Click()
  151.     MousePointer = 11
  152.     Dim webber As Object
  153.     Dim webURL As String
  154.     Set webber = CreateObject("FrontPage.Explorer")
  155.        
  156.     webURL = webber.vtiGetWebURL
  157.     If Len(webURL) > 0 Then
  158.         webber.vtiRefreshWebFromServer
  159.     Else
  160.         MsgBox "There must be an open web in the Explorer for vtiRefreshWebFromServer to work."
  161.     End If
  162.     Set webber = Nothing
  163.     MousePointer = 0
  164. End Sub
  165. Private Sub btnTop_Click()
  166.     MousePointer = 11
  167.     Dim webber As Object
  168.     Set webber = CreateObject("FrontPage.Explorer")
  169.     webber.vtiBringToTop
  170.     Set webber = Nothing
  171.     MousePointer = 0
  172. End Sub
  173.