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

  1. VERSION 5.00
  2. Begin VB.Form frmAddTask 
  3.    Caption         =   "Add Task"
  4.    ClientHeight    =   5505
  5.    ClientLeft      =   2160
  6.    ClientTop       =   2190
  7.    ClientWidth     =   5025
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   5505
  11.    ScaleWidth      =   5025
  12.    Begin VB.CommandButton btnClear 
  13.       Caption         =   "Clear"
  14.       Height          =   315
  15.       Left            =   4260
  16.       TabIndex        =   19
  17.       Top             =   2700
  18.       Width           =   615
  19.    End
  20.    Begin VB.CommandButton btnBrowse 
  21.       Caption         =   "Browse..."
  22.       Height          =   315
  23.       Left            =   3300
  24.       TabIndex        =   18
  25.       Top             =   2700
  26.       Width           =   915
  27.    End
  28.    Begin VB.Frame Frame1 
  29.       Caption         =   "Priority"
  30.       Height          =   675
  31.       Left            =   1260
  32.       TabIndex        =   9
  33.       Top             =   1500
  34.       Width           =   3615
  35.       Begin VB.OptionButton optLow 
  36.          Caption         =   "Low"
  37.          Height          =   255
  38.          Left            =   2520
  39.          TabIndex        =   12
  40.          Top             =   300
  41.          Width           =   1035
  42.       End
  43.       Begin VB.OptionButton optMedium 
  44.          Caption         =   "Medium"
  45.          Height          =   255
  46.          Left            =   1320
  47.          TabIndex        =   11
  48.          Top             =   300
  49.          Value           =   -1  'True
  50.          Width           =   1035
  51.       End
  52.       Begin VB.OptionButton optHigh 
  53.          Caption         =   "High"
  54.          Height          =   255
  55.          Left            =   360
  56.          TabIndex        =   10
  57.          Top             =   300
  58.          Width           =   1035
  59.       End
  60.    End
  61.    Begin VB.TextBox txtComment 
  62.       Height          =   315
  63.       Left            =   1260
  64.       TabIndex        =   8
  65.       Top             =   3540
  66.       Width           =   3615
  67.    End
  68.    Begin VB.TextBox txtCookie 
  69.       Height          =   315
  70.       Left            =   1260
  71.       TabIndex        =   7
  72.       Top             =   3120
  73.       Width           =   3615
  74.    End
  75.    Begin VB.TextBox txtURL 
  76.       Height          =   315
  77.       Left            =   1260
  78.       Locked          =   -1  'True
  79.       TabIndex        =   6
  80.       Top             =   2700
  81.       Width           =   1995
  82.    End
  83.    Begin VB.TextBox txtCreator 
  84.       Height          =   315
  85.       Left            =   1260
  86.       TabIndex        =   5
  87.       Text            =   "API Test Program"
  88.       Top             =   2280
  89.       Width           =   3615
  90.    End
  91.    Begin VB.TextBox txtTask 
  92.       Height          =   315
  93.       Left            =   1260
  94.       TabIndex        =   4
  95.       Text            =   "Edit This Page"
  96.       Top             =   1080
  97.       Width           =   3615
  98.    End
  99.    Begin VB.CommandButton btnTaskPrompt 
  100.       Caption         =   "Add Task For User"
  101.       Height          =   375
  102.       Left            =   2880
  103.       TabIndex        =   3
  104.       Top             =   4140
  105.       Width           =   1755
  106.    End
  107.    Begin VB.CommandButton btnAddTask 
  108.       Caption         =   "Add Task"
  109.       Height          =   375
  110.       Left            =   1260
  111.       TabIndex        =   2
  112.       Top             =   4140
  113.       Width           =   1455
  114.    End
  115.    Begin VB.Label Label8 
  116.       Caption         =   $"addtask.frx":0000
  117.       Height          =   855
  118.       Left            =   120
  119.       TabIndex        =   20
  120.       Top             =   4620
  121.       Width           =   4815
  122.       WordWrap        =   -1  'True
  123.    End
  124.    Begin VB.Label Label7 
  125.       Caption         =   "Comment:"
  126.       Height          =   255
  127.       Left            =   120
  128.       TabIndex        =   17
  129.       Top             =   3600
  130.       Width           =   1035
  131.    End
  132.    Begin VB.Label Label4 
  133.       Caption         =   "Cookie:"
  134.       Height          =   255
  135.       Left            =   120
  136.       TabIndex        =   16
  137.       Top             =   3180
  138.       Width           =   1035
  139.    End
  140.    Begin VB.Label Label3 
  141.       Caption         =   "URL:"
  142.       Height          =   255
  143.       Left            =   120
  144.       TabIndex        =   15
  145.       Top             =   2760
  146.       Width           =   1035
  147.    End
  148.    Begin VB.Label Label2 
  149.       Caption         =   "Created By:"
  150.       Height          =   255
  151.       Left            =   120
  152.       TabIndex        =   14
  153.       Top             =   2340
  154.       Width           =   1035
  155.    End
  156.    Begin VB.Label Label1 
  157.       Caption         =   "Task Name:"
  158.       Height          =   255
  159.       Left            =   120
  160.       TabIndex        =   13
  161.       Top             =   1140
  162.       Width           =   1035
  163.    End
  164.    Begin VB.Label Label6 
  165.       Alignment       =   2  'Center
  166.       Caption         =   "vtiAddTask, vtiAddTaskAskUser"
  167.       Height          =   255
  168.       Left            =   60
  169.       TabIndex        =   1
  170.       Top             =   420
  171.       Width           =   4935
  172.       WordWrap        =   -1  'True
  173.    End
  174.    Begin VB.Label Label5 
  175.       Caption         =   "This form uses the following FrontPage To Do List methods:"
  176.       Height          =   255
  177.       Left            =   60
  178.       TabIndex        =   0
  179.       Top             =   60
  180.       Width           =   4935
  181.    End
  182.    Begin VB.Line Line1 
  183.       X1              =   60
  184.       X2              =   4980
  185.       Y1              =   840
  186.       Y2              =   840
  187.    End
  188. Attribute VB_Name = "frmAddTask"
  189. Attribute VB_GlobalNameSpace = False
  190. Attribute VB_Creatable = False
  191. Attribute VB_PredeclaredId = True
  192. Attribute VB_Exposed = False
  193. Option Explicit
  194. Private Sub btnAddTask_Click()
  195.     Dim todolist As Object
  196.     Dim webber As Object
  197.     Dim webURL As String
  198.     Dim ret As Boolean
  199.     Dim url As String
  200.     Dim priority As Integer
  201.     MousePointer = 11
  202.     Set webber = CreateObject("FrontPage.Explorer")
  203.     webURL = webber.vtiGetWebURL
  204.     Set webber = Nothing
  205.     If Len(webURL) = 0 Then
  206.         MsgBox "No web is currently open in the Explorer."
  207.         Exit Sub
  208.     End If
  209.     If optHigh Then priority = 1
  210.     If optMedium Then priority = 2
  211.     If optLow Then priority = 3
  212.     Set todolist = CreateObject("FrontPage.ToDoList")
  213.     ret = todolist.vtiAddTask(txtTask, priority, txtCreator, txtURL, txtCookie, txtComment)
  214.     If Not ret Then
  215.         MsgBox "Failed to add task for To Do List."
  216.     End If
  217.     Set todolist = Nothing
  218.     frmGetURL.Tag = ""
  219.     MousePointer = 0
  220. End Sub
  221. Private Sub btnBrowse_Click()
  222.     MousePointer = 11
  223.     frmGetURL.Tag = ""
  224.     frmGetURL.Show 1
  225.     If frmGetURL.Tag <> "" Then
  226.         txtURL = frmGetURL.Tag
  227.     End If
  228.     frmGetURL.Tag = ""
  229.     MousePointer = 0
  230. End Sub
  231. Private Sub btnClear_Click()
  232.     txtURL = ""
  233. End Sub
  234. Private Sub btnTaskPrompt_Click()
  235.     Dim todolist As Object
  236.     Dim webber As Object
  237.     Dim webURL As String
  238.     Dim ret As Boolean
  239.     Dim url As String
  240.     Dim priority As Integer
  241.     MousePointer = 11
  242.     Set webber = CreateObject("FrontPage.Explorer")
  243.     webURL = webber.vtiGetWebURL
  244.     Set webber = Nothing
  245.     If Len(webURL) = 0 Then
  246.         MsgBox "No web is currently open in the Explorer."
  247.         Exit Sub
  248.     End If
  249.     If optHigh Then priority = 1
  250.     If optMedium Then priority = 2
  251.     If optLow Then priority = 3
  252.     Set todolist = CreateObject("FrontPage.ToDoList")
  253.     ret = todolist.vtiAddTaskAskUser(txtTask, priority, txtCreator, txtURL, txtCookie, txtComment)
  254.     If Not ret Then
  255.         MsgBox "Failed to add task for To Do List."
  256.     End If
  257.     Set todolist = Nothing
  258.     frmGetURL.Tag = ""
  259.     MousePointer = 0
  260. End Sub
  261. Private Sub Form_Load()
  262.     btnAddTask.Enabled = False
  263.     btnTaskPrompt.Enabled = False
  264. End Sub
  265. Private Sub txtURL_Change()
  266.     btnAddTask.Enabled = Len(txtURL.Text) > 0
  267.     btnTaskPrompt.Enabled = Len(txtURL.Text) > 0
  268. End Sub
  269.