home *** CD-ROM | disk | FTP | other *** search
/ Chip Special: HTML & Java / Chip-Special_1997-01_HTML-a-Java.bin / chatsdk / chatsdk.exe / TRNSCRPT.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-12-12  |  28.0 KB  |  804 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Chat Transcripter"
  4.    ClientHeight    =   6696
  5.    ClientLeft      =   1356
  6.    ClientTop       =   1488
  7.    ClientWidth     =   7380
  8.    FillColor       =   &H00FF0000&
  9.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  10.       Name            =   "MS Sans Serif"
  11.       Size            =   9.6
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H000000FF&
  19.    Height          =   7020
  20.    Left            =   1308
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   6696
  23.    ScaleWidth      =   7380
  24.    Top             =   1212
  25.    Width           =   7476
  26.    Begin VB.Frame Frame3 
  27.       Caption         =   "Chat Transcripter Session"
  28.       Height          =   3252
  29.       Left            =   120
  30.       TabIndex        =   14
  31.       Top             =   3240
  32.       Width           =   7092
  33.       Begin VB.Timer Timer2 
  34.          Enabled         =   0   'False
  35.          Interval        =   1000
  36.          Left            =   4440
  37.          Top             =   240
  38.       End
  39.       Begin VB.Timer Timer1 
  40.          Interval        =   1000
  41.          Left            =   5880
  42.          Top             =   240
  43.       End
  44.       Begin MSChatObjectsCtl.MSChat MSChat1 
  45.          Height          =   2892
  46.          Left            =   120
  47.          TabIndex        =   15
  48.          Top             =   240
  49.          Width           =   6852
  50.          _ExtentX        =   12086
  51.          _ExtentY        =   5101
  52.          UIOption        =   3980
  53.          BackColor       =   255
  54.       End
  55.    End
  56.    Begin VB.Frame Frame2 
  57.       Caption         =   "Chat Transcripter Commands"
  58.       Height          =   732
  59.       Left            =   120
  60.       TabIndex        =   11
  61.       Top             =   2400
  62.       Width           =   7092
  63.       Begin VB.CommandButton CurTranscript 
  64.          Caption         =   "View Current Transcript"
  65.          Height          =   372
  66.          Left            =   3960
  67.          TabIndex        =   13
  68.          Top             =   240
  69.          Width           =   3012
  70.       End
  71.       Begin VB.CommandButton TranscriptCmd 
  72.          Caption         =   "Start Transcribing"
  73.          Height          =   372
  74.          Left            =   120
  75.          TabIndex        =   12
  76.          Top             =   240
  77.          Width           =   3732
  78.       End
  79.    End
  80.    Begin VB.Frame Frame1 
  81.       Caption         =   "Chat Transcripter Options"
  82.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  83.          Name            =   "Times New Roman"
  84.          Size            =   10.2
  85.          Charset         =   0
  86.          Weight          =   700
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       Height          =   2292
  92.       Left            =   120
  93.       TabIndex        =   0
  94.       Top             =   120
  95.       Width           =   7092
  96.       Begin VB.TextBox Peak 
  97.          BackColor       =   &H00FF80FF&
  98.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  99.             Name            =   "Arial"
  100.             Size            =   7.8
  101.             Charset         =   0
  102.             Weight          =   700
  103.             Underline       =   0   'False
  104.             Italic          =   0   'False
  105.             Strikethrough   =   0   'False
  106.          EndProperty
  107.          ForeColor       =   &H00000000&
  108.          Height          =   288
  109.          Left            =   3480
  110.          TabIndex        =   28
  111.          Top             =   1838
  112.          Visible         =   0   'False
  113.          Width           =   852
  114.       End
  115.       Begin VB.TextBox Total 
  116.          BackColor       =   &H00FF80FF&
  117.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  118.             Name            =   "Arial"
  119.             Size            =   7.8
  120.             Charset         =   0
  121.             Weight          =   700
  122.             Underline       =   0   'False
  123.             Italic          =   0   'False
  124.             Strikethrough   =   0   'False
  125.          EndProperty
  126.          ForeColor       =   &H00FF0000&
  127.          Height          =   288
  128.          Left            =   3480
  129.          TabIndex        =   26
  130.          Top             =   1560
  131.          Visible         =   0   'False
  132.          Width           =   852
  133.       End
  134.       Begin VB.TextBox Current 
  135.          BackColor       =   &H00FF80FF&
  136.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  137.             Name            =   "Arial"
  138.             Size            =   7.8
  139.             Charset         =   0
  140.             Weight          =   700
  141.             Underline       =   0   'False
  142.             Italic          =   0   'False
  143.             Strikethrough   =   0   'False
  144.          EndProperty
  145.          ForeColor       =   &H0000FF00&
  146.          Height          =   288
  147.          Left            =   3480
  148.          TabIndex        =   24
  149.          Top             =   1320
  150.          Visible         =   0   'False
  151.          Width           =   852
  152.       End
  153.       Begin VB.TextBox HostKey 
  154.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  155.             Name            =   "Times New Roman"
  156.             Size            =   10.2
  157.             Charset         =   0
  158.             Weight          =   400
  159.             Underline       =   0   'False
  160.             Italic          =   0   'False
  161.             Strikethrough   =   0   'False
  162.          EndProperty
  163.          Height          =   336
  164.          Left            =   5640
  165.          TabIndex        =   22
  166.          Top             =   840
  167.          Width           =   1212
  168.       End
  169.       Begin VB.CheckBox MembStatus 
  170.          Caption         =   "Allow Participation"
  171.          Height          =   240
  172.          Left            =   4680
  173.          TabIndex        =   19
  174.          Top             =   1320
  175.          Width           =   2052
  176.       End
  177.       Begin VB.TextBox Interval 
  178.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  179.             Name            =   "Times New Roman"
  180.             Size            =   10.2
  181.             Charset         =   0
  182.             Weight          =   400
  183.             Underline       =   0   'False
  184.             Italic          =   0   'False
  185.             Strikethrough   =   0   'False
  186.          EndProperty
  187.          Height          =   336
  188.          Left            =   2040
  189.          TabIndex        =   18
  190.          Text            =   "1"
  191.          Top             =   1320
  192.          Width           =   372
  193.       End
  194.       Begin VB.CheckBox TextSpacing 
  195.          Caption         =   "Text Spacing"
  196.          Height          =   252
  197.          Left            =   4680
  198.          TabIndex        =   16
  199.          Top             =   1580
  200.          Value           =   1  'Checked
  201.          Width           =   1692
  202.       End
  203.       Begin VB.CheckBox Reconnect 
  204.          Caption         =   "AutoReconnect"
  205.          Height          =   252
  206.          Left            =   4680
  207.          TabIndex        =   10
  208.          Top             =   1860
  209.          Width           =   1692
  210.       End
  211.       Begin VB.TextBox ChatRoom 
  212.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  213.             Name            =   "Times New Roman"
  214.             Size            =   10.2
  215.             Charset         =   0
  216.             Weight          =   400
  217.             Underline       =   0   'False
  218.             Italic          =   0   'False
  219.             Strikethrough   =   0   'False
  220.          EndProperty
  221.          Height          =   336
  222.          Left            =   1560
  223.          TabIndex        =   9
  224.          Text            =   "//ChatSrv1/#ChatRoom"
  225.          Top             =   360
  226.          Width           =   2292
  227.       End
  228.       Begin VB.CommandButton Browse 
  229.          Caption         =   "..."
  230.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  231.             Name            =   "Times New Roman"
  232.             Size            =   10.8
  233.             Charset         =   0
  234.             Weight          =   700
  235.             Underline       =   0   'False
  236.             Italic          =   0   'False
  237.             Strikethrough   =   0   'False
  238.          EndProperty
  239.          Height          =   372
  240.          Left            =   3960
  241.          TabIndex        =   8
  242.          Top             =   840
  243.          Width           =   372
  244.       End
  245.       Begin VB.TextBox TranscriptFile 
  246.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  247.             Name            =   "Times New Roman"
  248.             Size            =   10.2
  249.             Charset         =   0
  250.             Weight          =   400
  251.             Underline       =   0   'False
  252.             Italic          =   0   'False
  253.             Strikethrough   =   0   'False
  254.          EndProperty
  255.          Height          =   336
  256.          Left            =   1560
  257.          TabIndex        =   7
  258.          Top             =   840
  259.          Width           =   2292
  260.       End
  261.       Begin VB.TextBox Alias 
  262.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  263.             Name            =   "Times New Roman"
  264.             Size            =   10.2
  265.             Charset         =   0
  266.             Weight          =   400
  267.             Underline       =   0   'False
  268.             Italic          =   0   'False
  269.             Strikethrough   =   0   'False
  270.          EndProperty
  271.          Height          =   336
  272.          Left            =   5640
  273.          TabIndex        =   6
  274.          Text            =   "Transcripter"
  275.          Top             =   360
  276.          Width           =   1212
  277.       End
  278.       Begin VB.TextBox Retries 
  279.          Enabled         =   0   'False
  280.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  281.             Name            =   "Times New Roman"
  282.             Size            =   10.2
  283.             Charset         =   0
  284.             Weight          =   400
  285.             Underline       =   0   'False
  286.             Italic          =   0   'False
  287.             Strikethrough   =   0   'False
  288.          EndProperty
  289.          Height          =   336
  290.          Left            =   2040
  291.          TabIndex        =   5
  292.          Text            =   "2"
  293.          Top             =   1800
  294.          Width           =   372
  295.       End
  296.       Begin VB.Label Label10 
  297.          BackColor       =   &H00FF80FF&
  298.          BorderStyle     =   1  'Fixed Single
  299.          Caption         =   "Peak"
  300.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  301.             Name            =   "Arial"
  302.             Size            =   12
  303.             Charset         =   0
  304.             Weight          =   400
  305.             Underline       =   0   'False
  306.             Italic          =   0   'False
  307.             Strikethrough   =   0   'False
  308.          EndProperty
  309.          ForeColor       =   &H00000000&
  310.          Height          =   288
  311.          Left            =   2640
  312.          TabIndex        =   27
  313.          Top             =   1838
  314.          Visible         =   0   'False
  315.          Width           =   852
  316.       End
  317.       Begin VB.Label Label9 
  318.          BackColor       =   &H00FF80FF&
  319.          BorderStyle     =   1  'Fixed Single
  320.          Caption         =   "Total"
  321.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  322.             Name            =   "Arial"
  323.             Size            =   12
  324.             Charset         =   0
  325.             Weight          =   400
  326.             Underline       =   0   'False
  327.             Italic          =   0   'False
  328.             Strikethrough   =   0   'False
  329.          EndProperty
  330.          ForeColor       =   &H00FF0000&
  331.          Height          =   288
  332.          Left            =   2640
  333.          TabIndex        =   25
  334.          Top             =   1560
  335.          Visible         =   0   'False
  336.          Width           =   852
  337.       End
  338.       Begin VB.Label Label8 
  339.          BackColor       =   &H00FF80FF&
  340.          BorderStyle     =   1  'Fixed Single
  341.          Caption         =   "Current"
  342.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  343.             Name            =   "Arial"
  344.             Size            =   12
  345.             Charset         =   0
  346.             Weight          =   400
  347.             Underline       =   0   'False
  348.             Italic          =   0   'False
  349.             Strikethrough   =   0   'False
  350.          EndProperty
  351.          ForeColor       =   &H0000FF00&
  352.          Height          =   288
  353.          Left            =   2640
  354.          TabIndex        =   23
  355.          Top             =   1320
  356.          Visible         =   0   'False
  357.          Width           =   852
  358.       End
  359.       Begin VB.Label Label7 
  360.          Caption         =   "Host Key"
  361.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  362.             Name            =   "Times New Roman"
  363.             Size            =   10.8
  364.             Charset         =   0
  365.             Weight          =   700
  366.             Underline       =   0   'False
  367.             Italic          =   0   'False
  368.             Strikethrough   =   0   'False
  369.          EndProperty
  370.          Height          =   252
  371.          Left            =   4680
  372.          TabIndex        =   21
  373.          Top             =   860
  374.          Width           =   1452
  375.       End
  376.       Begin VB.Label Label6 
  377.          Alignment       =   2  'Center
  378.          Caption         =   "(Minutes)"
  379.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  380.             Name            =   "Times New Roman"
  381.             Size            =   7.8
  382.             Charset         =   0
  383.             Weight          =   400
  384.             Underline       =   0   'False
  385.             Italic          =   0   'False
  386.             Strikethrough   =   0   'False
  387.          EndProperty
  388.          Height          =   204
  389.          Left            =   480
  390.          TabIndex        =   20
  391.          Top             =   1560
  392.          Width           =   732
  393.       End
  394.       Begin VB.Label Label5 
  395.          Caption         =   "Log Interval"
  396.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  397.             Name            =   "Times New Roman"
  398.             Size            =   10.8
  399.             Charset         =   0
  400.             Weight          =   700
  401.             Underline       =   0   'False
  402.             Italic          =   0   'False
  403.             Strikethrough   =   0   'False
  404.          EndProperty
  405.          Height          =   252
  406.          Left            =   240
  407.          TabIndex        =   17
  408.          Top             =   1360
  409.          Width           =   1212
  410.       End
  411.       Begin MSComDlg.CommonDialog CommonDialog1 
  412.          Left            =   3960
  413.          Top             =   360
  414.          _Version        =   65536
  415.          _ExtentX        =   677
  416.          _ExtentY        =   677
  417.          _StockProps     =   0
  418.          DefaultExt      =   ".txt"
  419.          DialogTitle     =   "ChatTranscript File"
  420.          Filter          =   "Text (*.txt)|*.txt|All (*.*)|*.*"
  421.          FilterIndex     =   1
  422.          InitDir         =   "."
  423.       End
  424.       Begin VB.Label Label4 
  425.          Caption         =   "Number of Retries"
  426.          Enabled         =   0   'False
  427.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  428.             Name            =   "Times New Roman"
  429.             Size            =   10.8
  430.             Charset         =   0
  431.             Weight          =   700
  432.             Underline       =   0   'False
  433.             Italic          =   0   'False
  434.             Strikethrough   =   0   'False
  435.          EndProperty
  436.          Height          =   252
  437.          Left            =   240
  438.          TabIndex        =   4
  439.          Top             =   1800
  440.          Width           =   1812
  441.       End
  442.       Begin VB.Label Label3 
  443.          Caption         =   "Alias"
  444.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  445.             Name            =   "Times New Roman"
  446.             Size            =   10.8
  447.             Charset         =   0
  448.             Weight          =   700
  449.             Underline       =   0   'False
  450.             Italic          =   0   'False
  451.             Strikethrough   =   0   'False
  452.          EndProperty
  453.          Height          =   252
  454.          Left            =   4680
  455.          TabIndex        =   3
  456.          Top             =   400
  457.          Width           =   492
  458.       End
  459.       Begin VB.Label Label2 
  460.          Caption         =   "Log File"
  461.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  462.             Name            =   "Times New Roman"
  463.             Size            =   10.8
  464.             Charset         =   0
  465.             Weight          =   700
  466.             Underline       =   0   'False
  467.             Italic          =   0   'False
  468.             Strikethrough   =   0   'False
  469.          EndProperty
  470.          Height          =   252
  471.          Left            =   240
  472.          TabIndex        =   2
  473.          Top             =   880
  474.          Width           =   1452
  475.       End
  476.       Begin VB.Label Label1 
  477.          Caption         =   "Chat Room"
  478.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  479.             Name            =   "Times New Roman"
  480.             Size            =   10.8
  481.             Charset         =   0
  482.             Weight          =   700
  483.             Underline       =   0   'False
  484.             Italic          =   0   'False
  485.             Strikethrough   =   0   'False
  486.          EndProperty
  487.          Height          =   252
  488.          Left            =   240
  489.          TabIndex        =   1
  490.          Top             =   400
  491.          Width           =   1212
  492.       End
  493.    End
  494. Attribute VB_Name = "Form1"
  495. Attribute VB_Creatable = False
  496. Attribute VB_Exposed = False
  497. Const INSERT_BLANK = &H100&
  498. Const ALLOW_RESIZING = &H400&
  499. Const SENSITIVE_URLS = &H800&
  500. Const SEND_BUTTON = &H1&
  501. Const WHISPER_BUTTON = &H2&
  502. Const SEND_TEXTBOX = &H10&
  503. Const INFORM_JOIN = &H20&
  504. Const INFORM_LEAVE = &H40&
  505. Const MASK_PRIVILEGES = &H1&
  506. Const STAT_PARTICIPANT = &H2&
  507. Const STAT_SPECTATOR = &H4&
  508. Public TimerTicks As Integer
  509. Public CurTicks As Integer
  510. Public CancelFlag As Boolean
  511. Public CurTry As Integer
  512. Public TotalCount As Integer
  513. Public MaxCount As Integer
  514. Sub Enable_ChatOptions(ByVal flag As Boolean)
  515. ChatRoom.Enabled = flag
  516. TranscriptFile.Enabled = flag
  517. Alias.Enabled = flag
  518. Browse.Enabled = flag
  519. HostKey.Enabled = flag
  520. Label1.Enabled = flag
  521. Label2.Enabled = flag
  522. Label3.Enabled = flag
  523. Label7.Enabled = flag
  524. Timer1.Enabled = Not flag
  525. If (HostKey.Text = "") Then
  526.     current.Visible = False
  527.     total.Visible = False
  528.     Peak.Visible = False
  529.     Label8.Visible = False
  530.     Label9.Visible = False
  531.     Label10.Visible = False
  532.     current.Visible = Not flag
  533.     total.Visible = Not flag
  534.     Peak.Visible = Not flag
  535.     Label8.Visible = Not flag
  536.     Label9.Visible = Not flag
  537.     Label10.Visible = Not flag
  538. End If
  539. End Sub
  540. Sub Set_FileName()
  541. strFileName = ChatRoom.Text
  542.     nPos = InStr(strFileName, "/")
  543.     If (nPos > 0) Then
  544.         strTemp = Mid(strFileName, nPos + 1)
  545.         strFileName = strTemp
  546.     End If
  547. Loop Until nPos = 0
  548. TranscriptFile.Text = strFileName + ".txt"
  549. If (HostKey.Text = "") Then
  550. TranscriptFile.Text = "Host_" + TranscriptFile.Text
  551. End If
  552. End Sub
  553. Sub Update_File(ByVal Stats As Boolean)
  554. 'MsgBox "Update File Called", , "testing"
  555. On Error GoTo ErrorHandler
  556. CurHistory = MSChat1.History
  557. If ((CurHistory <> "") Or (Stats)) Then
  558.     CurTranscript.Enabled = False
  559.     Open TranscriptFile.Text For Append Access Write As #1
  560.     Print #1, CurHistory
  561.     MSChat1.ClearHistory
  562.      
  563.     If (Stats And (HostKey.Text <> "")) Then
  564.         TempStr = ":::::::::::::::::::::::::::::::::::::::::"
  565.         Print #1, TempStr, TempStr, TempStr, TempStr
  566.         Print #1, "    Chat Room:", ChatRoom.Text;
  567.         Print #1, "      ClosingTime :", Time$
  568.         Print #1, " "
  569.         Print #1, "Total number of participants : ";
  570.         Print #1, TotalCount
  571.         Print #1, "Peak participation during session: ";
  572.         Print #1, MaxCount
  573.         Print #1, " "
  574.         Print #1, TempStr, TempStr, TempStr, TempStr
  575. '        Print #1, "Current number of participants : "
  576. '        Print #1, current.Text
  577.     End If
  578.        
  579.     Close #1
  580.     CurTranscript.Enabled = True
  581. End If
  582. Exit Sub        ' Exit to avoid handler.
  583. ErrorHandler:   ' Error-handling routine.
  584.     Select Case Err.Number  ' Evaluate error number.
  585.         Case 75
  586.             Msg = "Error Saving Transcript File! Make Sure you have access privelages to the file"
  587.             MsgBox Msg, , TranscriptFile.Text
  588.             Err.Clear   ' Clear Err object fields
  589.         Case Else
  590.             ' Tell user what happened. Then clear the Err object.
  591.             Msg = "There was an error attempting to open the OLE object!"
  592.             MsgBox Msg, , Err.Number
  593.             Err.Clear   ' Clear Err object fields
  594.             ' Handle other situations here...
  595.     End Select
  596.     CurTranscript.Enabled = True
  597. End Sub
  598. Private Sub Browse_Click()
  599. Rem CommonDialog1.DefaultExt = ".txt"
  600. Rem CommonDialog1.Filter = "Text (*.txt)|*.txt|All (*.*)|*.*"
  601. Rem CommonDialog1.FilterIndex = 1
  602. Rem CommonDialog1.DialogTitle = "ChatTranscript File"
  603. Rem CommonDialog1.DefaultExt = ".txt"
  604. Rem CommonDialog1.DefaultExt = ".txt"
  605. CommonDialog1.filename = TranscriptFile.Text
  606. CommonDialog1.Flags = &H800& Or &H8000& Or &H2& Or &H200000 Or &H4&
  607. CommonDialog1.InitDir = "."
  608. 'CommonDialog1.Action = 2
  609. CommonDialog1.ShowSave
  610. TranscriptFile.Text = CommonDialog1.filename
  611. End Sub
  612. Private Sub ChatRoom_Change()
  613. 'Call Set_FileName
  614. End Sub
  615. Private Sub ChatRoom_LostFocus()
  616. Call Set_FileName
  617. End Sub
  618. Private Sub CurTranscript_Click()
  619.     On Error GoTo ErrorHandler   ' Defer error trapping.
  620.     Open TranscriptFile.Text For Input Access Read Shared As 2
  621.     FileStr = Input(LOF(2), 2)
  622.     Close #2
  623.     Load Form2
  624.     Form2.RichTextBox1.TextRTF = FileStr
  625.     Form2.Visible = True
  626. '    Else
  627. '        Msg = "Unable to Access Transcript File"
  628. '       MsgBox Msg, , TranscriptFile.Text
  629. '  End If
  630.     'Form2.RichTextBox1.LoadFile TranscriptFile.Text, rtfText
  631.     Exit Sub        ' Exit to avoid handler.
  632. ErrorHandler:   ' Error-handling routine.
  633.     Select Case Err.Number  ' Evaluate error number.
  634.         Case 53
  635.             Msg = "Transcript File Doesn't exist"
  636.             MsgBox Msg, , TranscriptFile.Text
  637.             Err.Clear   ' Clear Err object fields
  638.            
  639.         Case 75
  640.             Msg = "Error Reading Transcript File! Make Sure the file exists"
  641.             MsgBox Msg, , TranscriptFile.Text
  642.             Err.Clear   ' Clear Err object fields
  643.         Case Else
  644.             ' Tell user what happened. Then clear the Err object.
  645.             Msg = "There was an error attempting to open the OLE object!"
  646.             MsgBox Msg, , Err.Number
  647.             Err.Clear   ' Clear Err object fields
  648.             ' Handle other situations here...
  649.     End Select
  650. End Sub
  651. Private Sub Form_Load()
  652. Call Set_FileName
  653. TimerTicks = Interval.Text
  654. CurTicks = 0
  655. CurTry = 0
  656. End Sub
  657. Private Sub HostKey_LostFocus()
  658.     If (Alias.Text = "Transcripter") Then
  659.         Alias.Text = "THost"
  660.     End If
  661.     If (InStr(TranscriptFile.Text, "Host_") = 0) Then
  662.             TranscriptFile.Text = "Host_" + TranscriptFile.Text
  663.     End If
  664. End Sub
  665. Private Sub Interval_Change()
  666.     iVal = 1
  667.     On Error Resume Next
  668.     iVal = CInt(Interval.Text)
  669.     Interval.Text = iVal
  670.     TimerTicks = iVal
  671. '    Timer1.Interval = 1000 * 60 * iVal ' Set interval.
  672. End Sub
  673. Private Sub MembStatus_Click()
  674. On Error Resume Next
  675. If (MembStatus.Value = 0) Then
  676. '    If (MSChat1.State = 3) Then
  677. '        MSChat1.SetParticipantStatus MSChat1.ThisParticipantID, MASK_PRIVILEGES, STAT_SPECTATOR
  678. '    End If
  679.     MSChat1.UIOption = MSChat1.UIOption And Not (SEND_TEXTBOX Or SEND_BUTTON Or WHISPER_BUTTON)
  680. '    If (MSChat1.State = 3) Then
  681. '        MSChat1.SetParticipantStatus MSChat1.ThisParticipantID, MASK_PRIVILEGES, STAT_PARTICIPANT
  682. '    End If
  683.     MSChat1.UIOption = MSChat1.UIOption Or (SEND_TEXTBOX Or SEND_BUTTON Or WHISPER_BUTTON)
  684. End If
  685. End Sub
  686. Private Sub MSChat1_OnBeginEnumeration()
  687.     TotalCount = 0
  688.     MaxCount = TotalCount
  689. End Sub
  690. Private Sub MSChat1_OnEnterParticipant(ByVal ParticipantID As Long, ByVal Alias As String, ByVal Status As Integer)
  691.     current.Text = MSChat1.MemberCount
  692.     TotalCount = TotalCount + 1
  693.     total.Text = TotalCount
  694.     If (MaxCount < MSChat1.MemberCount) Then
  695.         MaxCount = MSChat1.MemberCount
  696.         Peak.Text = MaxCount
  697.     End If
  698. End Sub
  699. Private Sub MSChat1_OnExitParticipant(ByVal ParticipantID As Long)
  700.     current.Text = MSChat1.MemberCount
  701. End Sub
  702. Private Sub MSChat1_OnHistoryFull(ByVal Percent As Integer)
  703. Call Update_File(False)
  704. End Sub
  705. Private Sub MSChat1_OnStateChanged(ByVal NewState As Integer)
  706.     If (NewState = 1) Then
  707.         Update_File (True)
  708.         
  709.         If ((CancelFlag = True) Or (Reconnect.Value = 0) Or ((Reconnect.Value = 1) And (CurTry >= Retries.Text))) Then
  710.             TranscriptCmd.Caption = "Start Transcribing"
  711.             TranscriptCmd.Enabled = True
  712.             MSChat1.BackColor = 255
  713.             CurTry = 0
  714.             Call Enable_ChatOptions(True)
  715.         Else
  716.             TranscriptCmd.Caption = "ReStarting Transcribing"
  717.             TranscriptCmd.Enabled = False
  718.             CurTry = CurTry + 1
  719.             MSChat1.BackColor = &HFF0000
  720.             Timer2.Interval = 30000
  721.             Timer2.Enabled = True
  722.         End If
  723.     Else
  724.         If (NewState = 2) Then
  725.             TranscriptCmd.Caption = "Cancel Entering"
  726.             MSChat1.BackColor = 33023
  727.         Else
  728.             On Error Resume Next
  729.             If (NewState = 3) Then
  730.                 TranscriptCmd.Caption = "Stop Transcribing"
  731.                 MSChat1.BackColor = 49152
  732.                 CurTry = 0
  733.                 TranscriptCmd.Enabled = True
  734.             End If
  735.         End If
  736.     End If
  737. End Sub
  738. Private Sub Reconnect_Click()
  739. If Reconnect.Value = 0 Then
  740.     Retries.Enabled = False
  741.     Label4.Enabled = False
  742.     Retries.Enabled = True
  743.     Label4.Enabled = True
  744. End If
  745. End Sub
  746. Private Sub TextSpacing_Click()
  747. If TextSpacing.Value = 0 Then
  748.     MSChat1.UIOption = MSChat1.UIOption And Not INSERT_BLANK
  749.     MSChat1.UIOption = MSChat1.UIOption Or INSERT_BLANK
  750. End If
  751. End Sub
  752. Private Sub Timer1_Timer()
  753. CurTicks = CurTicks + 1
  754. If (CurTicks >= TimerTicks) Then
  755.     CurTicks = 0
  756.     Call Update_File(False)
  757. End If
  758. End Sub
  759. Private Sub Timer2_Timer()
  760. If (MSChat1.State = 1) Then
  761.     Call TranscriptCmd_Click
  762. End If
  763. End Sub
  764. Private Sub TranscriptCmd_Click()
  765. If (MSChat1.State = 1) Then
  766.     Rem make sure the file is writable.
  767.     On Error GoTo ErrorHandler
  768.     Open TranscriptFile.Text For Append Access Write As #1
  769.     Close #1
  770.     Timer1.Interval = 60000  ' Set interval to be 1 minute.
  771.     Timer2.Enabled = False
  772.     CancelFlag = False
  773.     MSChat1.EnterRoom ChatRoom.Text, HostKey.Text, Alias.Text, "ANON;ALL", 1, 1
  774.     Call Enable_ChatOptions(False)
  775.     CancelFlag = True
  776.     If (MSChat1.State = 2) Then
  777.         TranscriptCmd.Enabled = False
  778.         MSChat1.CancelEntering
  779.         MSChat1.ClearHistory
  780.     Else
  781.         If (MSChat1.State = 3) Then
  782.             TranscriptCmd.Enabled = False
  783.             MSChat1.ExitRoom
  784.             MSChat1.ClearHistory
  785.         End If
  786.     End If
  787.     Call Enable_ChatOptions(True)
  788. End If
  789. Exit Sub        ' Exit to avoid handler.
  790. ErrorHandler:   ' Error-handling routine.
  791.     Select Case Err.Number  ' Evaluate error number.
  792.         Case 75
  793.             Msg = "Error Saving Transcript File! Make Sure you have access privelages to the file"
  794.             MsgBox Msg, , TranscriptFile.Text
  795.             Err.Clear   ' Clear Err object fields
  796.         Case Else
  797.             ' Tell user what happened. Then clear the Err object.
  798.             Msg = "There was an error attempting to open the OLE object!"
  799.             MsgBox Msg, , Err.Number
  800.             Err.Clear   ' Clear Err object fields
  801.             ' Handle other situations here...
  802.     End Select
  803. End Sub
  804.