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

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmOpenPage 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Open HTML Document from Disk"
  6.    ClientHeight    =   1905
  7.    ClientLeft      =   1605
  8.    ClientTop       =   2130
  9.    ClientWidth     =   5205
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    PaletteMode     =   1  'UseZOrder
  14.    ScaleHeight     =   1905
  15.    ScaleWidth      =   5205
  16.    ShowInTaskbar   =   0   'False
  17.    Begin VB.CommandButton btnOpenPage 
  18.       Caption         =   "Open Web Page"
  19.       Height          =   375
  20.       Left            =   1860
  21.       TabIndex        =   0
  22.       Top             =   1260
  23.       Width           =   1515
  24.    End
  25.    Begin MSComDlg.CommonDialog dlgOpen 
  26.       Left            =   4560
  27.       Top             =   1380
  28.       _ExtentX        =   847
  29.       _ExtentY        =   847
  30.       _Version        =   327680
  31.       CancelError     =   -1  'True
  32.       DefaultExt      =   ".htm"
  33.       DialogTitle     =   "Save As..."
  34.       FileName        =   "download.htm"
  35.       Filter          =   "*.htm"
  36.    End
  37.    Begin VB.Label Label6 
  38.       Alignment       =   2  'Center
  39.       Caption         =   "vtiOpenWebPage"
  40.       Height          =   255
  41.       Left            =   120
  42.       TabIndex        =   2
  43.       Top             =   480
  44.       Width           =   4935
  45.       WordWrap        =   -1  'True
  46.    End
  47.    Begin VB.Label Label5 
  48.       Caption         =   "This form uses the following FrontPage Editor methods:"
  49.       Height          =   255
  50.       Left            =   120
  51.       TabIndex        =   1
  52.       Top             =   120
  53.       Width           =   4935
  54.    End
  55.    Begin VB.Line Line1 
  56.       X1              =   120
  57.       X2              =   5040
  58.       Y1              =   960
  59.       Y2              =   960
  60.    End
  61. Attribute VB_Name = "frmOpenPage"
  62. Attribute VB_GlobalNameSpace = False
  63. Attribute VB_Creatable = False
  64. Attribute VB_PredeclaredId = True
  65. Attribute VB_Exposed = False
  66. Option Explicit
  67. Private Sub btnOpenPage_Click()
  68.     MousePointer = 11
  69.     Dim editor As Object
  70.     Dim page As Object
  71.     Dim canceled As Boolean
  72.     Dim ret As Long
  73.     Dim file As String
  74.     Dim url As String
  75.     canceled = False
  76.     Set editor = CreateObject("FrontPage.Editor")
  77.     On Error GoTo FileCancel
  78.     dlgOpen.Filter = "HTML Files (*.htm)|*.htm"
  79.     dlgOpen.DialogTitle = "Open HTML Document"
  80.     dlgOpen.filename = ""
  81.     dlgOpen.ShowOpen
  82.     If Not canceled And Len(dlgOpen.filename) > 0 Then
  83.         MousePointer = 11
  84.         file = dlgOpen.filename
  85.         url = dlgOpen.FileTitle
  86.         Set page = editor.vtiOpenWebPage(file, url, "", "")
  87.         Set page = Nothing
  88.     End If
  89.     MousePointer = 0
  90.     Set editor = Nothing
  91.     Exit Sub
  92. FileCancel:
  93.     canceled = True
  94.     Resume Next
  95. End Sub
  96.