home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD15723322001.psc / frmDocMaster.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-03-02  |  16.5 KB  |  541 lines

  1. VERSION 5.00
  2. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  3. Object = "{F5BE8BC2-7DE6-11D0-91FE-00C04FD701A5}#2.0#0"; "AGENTCTL.DLL"
  4. Object = "{97F4CED3-9103-11CE-8385-524153480001}#2.0#0"; "VSPELL32.OCX"
  5. Begin VB.Form frmDocMaster 
  6.    Caption         =   "Document "
  7.    ClientHeight    =   3780
  8.    ClientLeft      =   60
  9.    ClientTop       =   630
  10.    ClientWidth     =   7530
  11.    Icon            =   "frmDocMaster.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   3780
  15.    ScaleWidth      =   7530
  16.    WindowState     =   2  'Maximized
  17.    Begin RichTextLib.RichTextBox RichTextBox1 
  18.       Height          =   735
  19.       Left            =   3000
  20.       TabIndex        =   3
  21.       Top             =   1560
  22.       Visible         =   0   'False
  23.       Width           =   1575
  24.       _ExtentX        =   2778
  25.       _ExtentY        =   1296
  26.       _Version        =   393217
  27.       TextRTF         =   $"frmDocMaster.frx":0442
  28.    End
  29.    Begin VB.TextBox Text2 
  30.       Height          =   495
  31.       Left            =   3120
  32.       TabIndex        =   1
  33.       Top             =   1680
  34.       Visible         =   0   'False
  35.       Width           =   1215
  36.    End
  37.    Begin RichTextLib.RichTextBox Text1 
  38.       Height          =   7455
  39.       Left            =   0
  40.       TabIndex        =   0
  41.       Top             =   0
  42.       Width           =   11805
  43.       _ExtentX        =   20823
  44.       _ExtentY        =   13150
  45.       _Version        =   393217
  46.       Enabled         =   -1  'True
  47.       ScrollBars      =   3
  48.       TextRTF         =   $"frmDocMaster.frx":04F0
  49.    End
  50.    Begin VspelocxLib.VSSpell VSSpell1 
  51.       Left            =   3600
  52.       OleObjectBlob   =   "frmDocMaster.frx":059E
  53.       Top             =   1680
  54.    End
  55.    Begin VB.Label Label1 
  56.       Height          =   495
  57.       Left            =   3120
  58.       TabIndex        =   2
  59.       Top             =   1680
  60.       Visible         =   0   'False
  61.       Width           =   1215
  62.    End
  63.    Begin AgentObjectsCtl.Agent Agent1 
  64.       Left            =   3480
  65.       Top             =   1680
  66.       _cx             =   847
  67.       _cy             =   847
  68.    End
  69.    Begin VB.Menu File 
  70.       Caption         =   "&File"
  71.       Begin VB.Menu new 
  72.          Caption         =   "&New"
  73.          Shortcut        =   ^N
  74.       End
  75.       Begin VB.Menu border3 
  76.          Caption         =   "-"
  77.       End
  78.       Begin VB.Menu Open 
  79.          Caption         =   "&Open"
  80.          Shortcut        =   ^O
  81.       End
  82.       Begin VB.Menu Save 
  83.          Caption         =   "&Save"
  84.          Shortcut        =   ^S
  85.       End
  86.       Begin VB.Menu border1 
  87.          Caption         =   "-"
  88.       End
  89.       Begin VB.Menu PAGESETUP 
  90.          Caption         =   "&Page Setup"
  91.       End
  92.       Begin VB.Menu Preview 
  93.          Caption         =   "&Print Preview "
  94.       End
  95.       Begin VB.Menu Pirnt 
  96.          Caption         =   "&Print"
  97.          Shortcut        =   ^P
  98.       End
  99.       Begin VB.Menu border2 
  100.          Caption         =   "-"
  101.       End
  102.       Begin VB.Menu Send 
  103.          Caption         =   "Sen&d..."
  104.       End
  105.       Begin VB.Menu newborder 
  106.          Caption         =   "-"
  107.       End
  108.       Begin VB.Menu Exit 
  109.          Caption         =   "&Exit"
  110.       End
  111.    End
  112.    Begin VB.Menu Edit 
  113.       Caption         =   "&Edit"
  114.       Begin VB.Menu Cut 
  115.          Caption         =   "&Cut"
  116.          Shortcut        =   ^X
  117.       End
  118.       Begin VB.Menu Copy 
  119.          Caption         =   "&Copy"
  120.          Shortcut        =   ^C
  121.       End
  122.       Begin VB.Menu Paste 
  123.          Caption         =   "&Paste"
  124.          Shortcut        =   ^V
  125.       End
  126.       Begin VB.Menu Del 
  127.          Caption         =   "&Delete"
  128.       End
  129.       Begin VB.Menu border4 
  130.          Caption         =   "-"
  131.       End
  132.       Begin VB.Menu SELECTALL 
  133.          Caption         =   "&Select All"
  134.          Shortcut        =   ^A
  135.       End
  136.       Begin VB.Menu TIMEDATE 
  137.          Caption         =   "&Time/Date"
  138.       End
  139.    End
  140.    Begin VB.Menu Insert 
  141.       Caption         =   "&Insert"
  142.       Begin VB.Menu Piccy 
  143.          Caption         =   "&Picture"
  144.          Shortcut        =   {F9}
  145.       End
  146.       Begin VB.Menu Filey 
  147.          Caption         =   "&File"
  148.          Shortcut        =   {F11}
  149.       End
  150.       Begin VB.Menu TFB 
  151.          Caption         =   "-"
  152.       End
  153.       Begin VB.Menu TFILE 
  154.          Caption         =   "&Text File"
  155.          Shortcut        =   {F12}
  156.       End
  157.       Begin VB.Menu brandnewbo 
  158.          Caption         =   "-"
  159.       End
  160.       Begin VB.Menu Font 
  161.          Caption         =   "&Font"
  162.       End
  163.       Begin VB.Menu brandnewb 
  164.          Caption         =   "-"
  165.       End
  166.       Begin VB.Menu Bullet 
  167.          Caption         =   "&Bullet"
  168.       End
  169.       Begin VB.Menu bulletborder 
  170.          Caption         =   "-"
  171.       End
  172.       Begin VB.Menu Colour 
  173.          Caption         =   "&Colour"
  174.       End
  175.    End
  176.    Begin VB.Menu Agent 
  177.       Caption         =   "&Agent"
  178.       Begin VB.Menu DICTATEDOC 
  179.          Caption         =   "&Dictate Document..."
  180.       End
  181.    End
  182.    Begin VB.Menu Format 
  183.       Caption         =   "&Format"
  184.       Begin VB.Menu Paragraph 
  185.          Caption         =   "&Paragraph"
  186.          Begin VB.Menu Left 
  187.             Caption         =   "&Left "
  188.          End
  189.          Begin VB.Menu Right 
  190.             Caption         =   "&Right"
  191.          End
  192.          Begin VB.Menu Center 
  193.             Caption         =   "&Center"
  194.          End
  195.       End
  196.    End
  197.    Begin VB.Menu Tools 
  198.       Caption         =   "&Tools"
  199.       Begin VB.Menu SpellCheck 
  200.          Caption         =   "&Spell Check All Text"
  201.          Shortcut        =   {F5}
  202.       End
  203.       Begin VB.Menu SCSW 
  204.          Caption         =   "&Spell Check Single Word"
  205.       End
  206.       Begin VB.Menu spswb 
  207.          Caption         =   "-"
  208.       End
  209.       Begin VB.Menu newemail 
  210.          Caption         =   "&New Email"
  211.       End
  212.       Begin VB.Menu newemailborder 
  213.          Caption         =   "-"
  214.       End
  215.       Begin VB.Menu View 
  216.          Caption         =   "&View"
  217.          Begin VB.Menu InMicrosoftWord 
  218.             Caption         =   "&In Microsoft Word..."
  219.          End
  220.       End
  221.    End
  222.    Begin VB.Menu Window 
  223.       Caption         =   "&Window"
  224.       Begin VB.Menu Cascade 
  225.          Caption         =   "&Cascade"
  226.       End
  227.       Begin VB.Menu THORIZONTAL 
  228.          Caption         =   "&Tile Horizontal"
  229.       End
  230.       Begin VB.Menu TVERTICAL 
  231.          Caption         =   "&Tile Vertical"
  232.       End
  233.       Begin VB.Menu ARRANGEICONS 
  234.          Caption         =   "&Arrange Icons"
  235.       End
  236.    End
  237.    Begin VB.Menu HELP 
  238.       Caption         =   "&Help"
  239.       Begin VB.Menu EMAILTHEAUTHOR 
  240.          Caption         =   "&Email The Author"
  241.       End
  242.       Begin VB.Menu bnborder 
  243.          Caption         =   "-"
  244.       End
  245.       Begin VB.Menu HowDoI 
  246.          Caption         =   "&How Do I"
  247.          Begin VB.Menu PRINTPREVIEWH 
  248.             Caption         =   "&Print Preview"
  249.          End
  250.          Begin VB.Menu PMYDOC 
  251.             Caption         =   "&Print My Document"
  252.          End
  253.          Begin VB.Menu SMDOC 
  254.             Caption         =   "&Send My Document"
  255.          End
  256.          Begin VB.Menu SpellCheck2 
  257.             Caption         =   "&Spell Check"
  258.          End
  259.          Begin VB.Menu spbor 
  260.             Caption         =   "-"
  261.          End
  262.          Begin VB.Menu FOTOPIC 
  263.             Caption         =   "&Find Other Topic..."
  264.          End
  265.       End
  266.       Begin VB.Menu HELPTOPICS 
  267.          Caption         =   "&Help Topics"
  268.       End
  269.       Begin VB.Menu ABO 
  270.          Caption         =   "-"
  271.       End
  272.       Begin VB.Menu Credits 
  273.          Caption         =   "&Credits"
  274.       End
  275.       Begin VB.Menu aepb 
  276.          Caption         =   "-"
  277.       End
  278.       Begin VB.Menu AEP2001 
  279.          Caption         =   "&About TypePad 2001"
  280.       End
  281.    End
  282. Attribute VB_Name = "frmDocMaster"
  283. Attribute VB_GlobalNameSpace = False
  284. Attribute VB_Creatable = False
  285. Attribute VB_PredeclaredId = True
  286. Attribute VB_Exposed = False
  287. Private Sub AEP2001_Click()
  288. Form2.Show
  289. End Sub
  290. Private Sub ARRANGEICONS_Click()
  291. frmFrame.Arrange vbArrangeIcons
  292. End Sub
  293. Private Sub Bullet_Click()
  294. If Screen.ActiveForm.ActiveControl.SelBullet = False Then
  295.     Screen.ActiveForm.ActiveControl.SelBullet = True
  296.     Bullet.Checked = True
  297. If Screen.ActiveForm.ActiveControl.SelBullet = True Then
  298.     Screen.ActiveForm.ActiveControl.SelBullet = False
  299.     Bullet.Checked = False
  300. End If
  301. End If
  302. End Sub
  303. Private Sub Cascade_Click()
  304. frmFrame.Arrange vbCascade
  305. End Sub
  306. Private Sub Center_Click()
  307. Screen.ActiveForm.ActiveControl.SelAlignment = rtfCenter
  308. End Sub
  309. Private Sub Colour_Click()
  310. With frmFrame.CommonDialog1
  311.     .CancelError = True
  312.     .Flags = cdlCCFullOpen
  313.     .ShowColor
  314. End With
  315. Screen.ActiveForm.ActiveControl.SelColor = frmFrame.CommonDialog1.Color
  316. End Sub
  317. Private Sub Copy_Click()
  318. Clipboard.SetText Screen.ActiveForm.ActiveControl.SelText
  319. End Sub
  320. Private Sub Credits_Click()
  321. frmCredits.Show
  322. End Sub
  323. Private Sub Cut_Click()
  324. Clipboard.SetText Screen.ActiveForm.ActiveControl.SelText
  325. Screen.ActiveForm.ActiveControl.SelText = ""
  326. End Sub
  327. Private Sub Del_Click()
  328. If Screen.ActiveForm.ActiveControl.SelText = "" Then
  329.     MsgBox "Nothing to delete", vbInformation, "Error:"
  330.     Screen.ActiveForm.ActiveControl.SelText = ""
  331. End If
  332. End Sub
  333. Private Sub DICTATEDOC_Click()
  334. On Error Resume Next
  335. Set hanz = Agent1.Characters.Character("Hanz")
  336. hanz.Show
  337. hanz.Speak Screen.ActiveForm.ActiveControl.Text
  338. hanz.Hide
  339. End Sub
  340. Private Sub EMAILTHEAUTHOR_Click()
  341. Shell ("start mailto:ian@imckay.fsnet.co.uk"), vbHide
  342. End Sub
  343. Private Sub Exit_Click()
  344. Unload frmFrame
  345. End Sub
  346. Private Sub Filey_Click()
  347. On Error Resume Next
  348. With frmFrame.CommonDialog1
  349.     .CancelError = True
  350.     .Filter = "All Files|*.*"
  351.     .ShowOpen
  352. End With
  353. Screen.ActiveForm.ActiveControl.OLEObjects.Add , , frmFrame.CommonDialog1.FileName
  354. End Sub
  355. Private Sub Font_Click()
  356. On Error Resume Next
  357. With frmFrame.CommonDialog1
  358.     .CancelError = True
  359.     .Flags = cdlCFBoth + cdlCFEffects
  360.     .ShowFont
  361. End With
  362. Screen.ActiveForm.ActiveControl.Font.Name = frmFrame.CommonDialog1.FontName
  363. Screen.ActiveForm.ActiveControl.Font.Size = frmFrame.CommonDialog1.FontSize
  364. Screen.ActiveForm.ActiveControl.SelBold = frmFrame.CommonDialog1.FontBold
  365. Screen.ActiveForm.ActiveControl.SelItalic = frmFrame.CommonDialog1.FontItalic
  366. Screen.ActiveForm.ActiveControl.SelUnderline = frmFrame.CommonDialog1.FontUnderline
  367. Screen.ActiveForm.ActiveControl.SelStrikeThru = frmFrame.CommonDialog1.FontStrikethru
  368. Screen.ActiveForm.ActiveControl.SelColor = frmFrame.CommonDialog1.Color
  369. End Sub
  370. Private Sub Form_Load()
  371. Agent1.Characters.Load "Hanz", "Hanz.acs"
  372. Set hanz = Agent1.Characters.Character("Hanz")
  373. hanz.Hide
  374. End Sub
  375. Private Sub form_unload(cancel As Integer)
  376. On Error Resume Next
  377. Dim rtb1 As Integer
  378.     rtb1 = MsgBox("Would you like to save the changes to this document?", vbYesNo + vbQuestion, "Save Changes?")
  379.         Select Case rtb1
  380.             Case vbYes
  381.                 With frmFrame.CommonDialog1
  382.                     .CancelError = True
  383.                     .Filter = "RTF Files|*.rtf|TXT Files|*.txt|WRI Files|*.wri"
  384.                     .ShowSave
  385.                 End With
  386.                 Screen.ActiveForm.ActiveControl.SaveFile (frmFrame.CommonDialog1.FileName)
  387.             Case vbNo
  388.                 Exit Sub
  389.         End Select
  390. End Sub
  391. Private Sub FOTOPIC_Click()
  392. Form3.Show
  393. End Sub
  394. Private Sub HELPTOPICS_Click()
  395. Form3.Show
  396. End Sub
  397. Private Sub InMicrosoftWord_Click()
  398. On Error Resume Next
  399. Set word = CreateObject("word.basic")
  400. word.appshow
  401. word.filenew
  402. word.Insert Screen.ActiveForm.ActiveControl.Text
  403. End Sub
  404. Private Sub Left_Click()
  405. Screen.ActiveForm.ActiveControl.SelAlignment = rtfLeft
  406. End Sub
  407. Private Sub New_Click()
  408. On Error Resume Next
  409. Dim frmDocMaster As New frmDocMaster
  410.     frmDocMaster.Show
  411. End Sub
  412. Private Sub NEWEMAIL_Click()
  413. Shell ("START MAILTO:"), vbHide
  414. End Sub
  415. Private Sub Open_Click()
  416. ' Opens up a file for principal viewing
  417. On Error Resume Next
  418. With frmFrame.CommonDialog1
  419.     .CancelError = True
  420.     .Filter = "RTF Files, TXT Files, WRI Files|*.wri; *.txt; *.rtf;"
  421.     .ShowOpen
  422. End With
  423. Screen.ActiveForm.Caption = "Document -" + frmFrame.CommonDialog1.FileName
  424. Screen.ActiveForm.ActiveControl.LoadFile (frmFrame.CommonDialog1.FileName)
  425. End Sub
  426. Private Sub PAGESETUP_Click()
  427. ' Here is the Page Setup Option
  428.     frmPageSetup.Show vbModal
  429.     If gprint = True Then
  430.          frmDocPreview.DocPrintProc
  431.     End If
  432. End Sub
  433. Private Sub Paste_Click()
  434. Screen.ActiveForm.ActiveControl.SelText = Clipboard.GetText
  435. End Sub
  436. Private Sub Piccy_Click()
  437. On Error Resume Next
  438. With frmFrame.CommonDialog1
  439.     .CancelError = True
  440.     .Filter = "BMP Files, JPG Files, JPEG Files |*.bmp; *.jpg; *.jpeg;|All Files|*.*"
  441.     .ShowOpen
  442. End With
  443. Screen.ActiveForm.ActiveControl.OLEObjects.Add , , frmFrame.CommonDialog1.FileName
  444. End Sub
  445. Private Sub Pirnt_Click()
  446. frmDocPreview.DocPrintProc
  447. End Sub
  448. Private Sub PMYDOC_Click()
  449. Set hanz = Agent1.Characters.Character("Hanz")
  450. hanz.Show
  451. hanz.Speak "To Print a document, please go to the file menu and then click Print. Press OK to start printing or cancel to abort."
  452. hanz.Hide
  453. End Sub
  454. Private Sub Preview_Click()
  455.     frmDocPreview.Show vbModal
  456.     If gprint = True Then
  457.          frmDocPreview.DocPrintProc
  458.     End If
  459. End Sub
  460. Private Sub PRINTPREVIEWH_Click()
  461. Set hanz = Agent1.Characters.Character("Hanz")
  462. hanz.Show
  463. hanz.Speak "Please go to the file menu and then click Print Preview. The document shall then be displayed."
  464. hanz.Hide
  465. End Sub
  466. Private Sub Right_Click()
  467. Screen.ActiveForm.ActiveControl.SelAlignment = rtfRight
  468. End Sub
  469. Private Sub Save_Click()
  470. On Error Resume Next
  471. With frmFrame.CommonDialog1
  472.     .CancelError = True
  473.     .Filter = "RTF Files|*.rtf|TXT Files|*.txt|WRI Files|*.wri"
  474.     .ShowSave
  475. End With
  476. Screen.ActiveForm.ActiveControl.SaveFile (frmFrame.CommonDialog1.FileName)
  477. End Sub
  478. Private Sub SCSW_Click()
  479. ' Spell checks a single word in the document
  480. frmDocMaster.VSSpell1.CheckText = Screen.ActiveForm.ActiveControl.SelText
  481. If Screen.ActiveForm.ActiveControl.SelText = "" Then
  482.     MsgBox "No text to check", vbInformation, "Error"
  483.     Exit Sub
  484. End If
  485. If frmDocMaster.VSSpell1.ReplaceOccurred Then
  486.     Screen.ActiveForm.ActiveControl.SelText = frmDocMaster.VSSpell1.Text
  487.     MsgBox "The Spell Check Is Complete", vbInformation, "The Spell Check Is Complete!"
  488. End If
  489. End Sub
  490. Private Sub SELECTALL_Click()
  491. Screen.ActiveForm.ActiveControl.SelStart = 0
  492. Screen.ActiveForm.ActiveControl.SelLength = Len(Screen.ActiveControl)
  493. End Sub
  494. Private Sub Send_Click()
  495. frmMain.Show
  496. End Sub
  497. Private Sub SMDOC_Click()
  498. Set hanz = Agent1.Characters.Character("Hanz")
  499. hanz.Show
  500. hanz.Speak "Go to the File Menu and then click Send. This will display a send screen. Please fill in all your details and then click Send. Ensure that you are connected to the net before you do this. You must also know what your SMTP address is as well."
  501. hanz.Hide
  502. End Sub
  503. Private Sub SPELLCHECK_Click()
  504. frmDocMaster.VSSpell1.CheckText = Screen.ActiveForm.ActiveControl.Text
  505. If frmDocMaster.VSSpell1.ReplaceOccurred Then
  506.     Screen.ActiveForm.ActiveControl.Text = frmDocMaster.VSSpell1.Text
  507.     MsgBox "The Spell Check Is Complete.", vbInformation, "The Spell Check Is Complete!"
  508.     Exit Sub
  509. End If
  510. End Sub
  511. Private Sub SpellCheck2_Click()
  512. Set hanz = Agent1.Characters.Character("Hanz")
  513. hanz.Show
  514. hanz.Speak "Go to Tools and then click Spell Checker. This will find any misspelled words and give you the chance to replace them. All words should be replaced and then you can return to the document."
  515. hanz.Hide
  516. End Sub
  517. Private Sub Text1_Change()
  518. Screen.ActiveForm.ActiveControl.SaveFile ("c:\windows\temp.rtf")
  519. End Sub
  520. Private Sub TFILE_Click()
  521. On Error Resume Next
  522. With frmFrame.CommonDialog1
  523.     .CancelError = True
  524.     .DialogTitle = "Insert Text File..."
  525.     .Filter = "Text Files|*.txt"
  526.     .ShowOpen
  527. End With
  528. frmDocMaster.RichTextBox1.Text = ""
  529. frmDocMaster.RichTextBox1.LoadFile (frmFrame.CommonDialog1.FileName)
  530. Screen.ActiveForm.ActiveControl.SelText = frmDocMaster.RichTextBox1.Text
  531. End Sub
  532. Private Sub THORIZONTAL_Click()
  533. frmFrame.Arrange vbTileHorizontal
  534. End Sub
  535. Private Sub TIMEDATE_Click()
  536. Form1.Show
  537. End Sub
  538. Private Sub TVERTICAL_Click()
  539. frmFrame.Arrange vbTileVertical
  540. End Sub
  541.