home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD1194511222000.psc / frmMain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-11-22  |  34.8 KB  |  1,186 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  5. Begin VB.Form frmMain 
  6.    Caption         =   "Word2001"
  7.    ClientHeight    =   4740
  8.    ClientLeft      =   165
  9.    ClientTop       =   735
  10.    ClientWidth     =   7155
  11.    Icon            =   "frmMain.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   4740
  14.    ScaleWidth      =   7155
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.Timer AutoSave 
  17.       Left            =   5280
  18.       Top             =   480
  19.    End
  20.    Begin VB.Timer Timer1 
  21.       Interval        =   1000
  22.       Left            =   5760
  23.       Top             =   480
  24.    End
  25.    Begin VB.PictureBox Marline 
  26.       BackColor       =   &H00808080&
  27.       Height          =   3255
  28.       Left            =   120
  29.       ScaleHeight     =   3255
  30.       ScaleWidth      =   15
  31.       TabIndex        =   6
  32.       TabStop         =   0   'False
  33.       Top             =   1200
  34.       Visible         =   0   'False
  35.       Width           =   15
  36.    End
  37.    Begin MSComctlLib.Slider Slider1 
  38.       Height          =   255
  39.       Left            =   0
  40.       TabIndex        =   5
  41.       TabStop         =   0   'False
  42.       ToolTipText     =   "Margins"
  43.       Top             =   840
  44.       Width           =   7095
  45.       _ExtentX        =   12515
  46.       _ExtentY        =   450
  47.       _Version        =   393216
  48.       Max             =   100
  49.       TickStyle       =   3
  50.       TickFrequency   =   2
  51.    End
  52.    Begin VB.ComboBox Combo2 
  53.       Height          =   315
  54.       Left            =   2760
  55.       TabIndex        =   4
  56.       TabStop         =   0   'False
  57.       Text            =   "Combo2"
  58.       Top             =   480
  59.       Width           =   1095
  60.    End
  61.    Begin VB.ComboBox Combo1 
  62.       Height          =   315
  63.       Left            =   0
  64.       Sorted          =   -1  'True
  65.       Style           =   2  'Dropdown List
  66.       TabIndex        =   3
  67.       TabStop         =   0   'False
  68.       Top             =   480
  69.       Width           =   2655
  70.    End
  71.    Begin RichTextLib.RichTextBox Rt 
  72.       Height          =   3375
  73.       Left            =   0
  74.       TabIndex        =   0
  75.       Top             =   1080
  76.       Width           =   7095
  77.       _ExtentX        =   12515
  78.       _ExtentY        =   5953
  79.       _Version        =   393217
  80.       Enabled         =   -1  'True
  81.       ScrollBars      =   2
  82.       TextRTF         =   $"frmMain.frx":0442
  83.    End
  84.    Begin MSComctlLib.Toolbar tbToolBar 
  85.       Align           =   1  'Align Top
  86.       Height          =   420
  87.       Left            =   0
  88.       TabIndex        =   2
  89.       Top             =   0
  90.       Width           =   7155
  91.       _ExtentX        =   12621
  92.       _ExtentY        =   741
  93.       ButtonWidth     =   609
  94.       ButtonHeight    =   582
  95.       Appearance      =   1
  96.       ImageList       =   "imlToolbarIcons"
  97.       _Version        =   393216
  98.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  99.          NumButtons      =   21
  100.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  101.             Key             =   "New"
  102.             Object.ToolTipText     =   "New"
  103.             ImageIndex      =   1
  104.          EndProperty
  105.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  106.             Key             =   "Open"
  107.             Object.ToolTipText     =   "Open"
  108.             ImageIndex      =   3
  109.          EndProperty
  110.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  111.             Key             =   "Save"
  112.             Object.ToolTipText     =   "Save"
  113.             ImageIndex      =   4
  114.          EndProperty
  115.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  116.             ImageIndex      =   5
  117.             Style           =   3
  118.          EndProperty
  119.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  120.             Key             =   "Print"
  121.             Object.ToolTipText     =   "Print"
  122.             ImageIndex      =   5
  123.          EndProperty
  124.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  125.             Style           =   3
  126.          EndProperty
  127.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  128.             Key             =   "Cut"
  129.             Object.ToolTipText     =   "Cut"
  130.             ImageIndex      =   6
  131.          EndProperty
  132.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  133.             Key             =   "Copy"
  134.             Object.ToolTipText     =   "Copy"
  135.             ImageIndex      =   7
  136.          EndProperty
  137.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  138.             Key             =   "Paste"
  139.             Object.ToolTipText     =   "Paste"
  140.             ImageIndex      =   8
  141.          EndProperty
  142.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  143.             ImageIndex      =   9
  144.             Style           =   3
  145.          EndProperty
  146.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  147.             Key             =   "Bold"
  148.             Object.ToolTipText     =   "Bold"
  149.             ImageIndex      =   9
  150.          EndProperty
  151.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  152.             Key             =   "Italic"
  153.             Object.ToolTipText     =   "Italic"
  154.             ImageIndex      =   10
  155.          EndProperty
  156.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  157.             Key             =   "Underline"
  158.             Object.ToolTipText     =   "Underline"
  159.             ImageIndex      =   11
  160.          EndProperty
  161.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  162.             ImageIndex      =   13
  163.             Style           =   3
  164.          EndProperty
  165.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  166.             Key             =   "Align Left"
  167.             Object.ToolTipText     =   "Align Left"
  168.             ImageIndex      =   12
  169.             Style           =   2
  170.          EndProperty
  171.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  172.             Key             =   "Center"
  173.             Object.ToolTipText     =   "Center"
  174.             ImageIndex      =   13
  175.             Style           =   2
  176.          EndProperty
  177.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  178.             Key             =   "Align Right"
  179.             Object.ToolTipText     =   "Align Right"
  180.             ImageIndex      =   14
  181.             Style           =   2
  182.          EndProperty
  183.          BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  184.             Style           =   3
  185.          EndProperty
  186.          BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  187.             Key             =   "Color"
  188.             Object.ToolTipText     =   "Change Color"
  189.             ImageIndex      =   15
  190.          EndProperty
  191.          BeginProperty Button20 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  192.             Style           =   3
  193.          EndProperty
  194.          BeginProperty Button21 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  195.             Key             =   "Find"
  196.             Object.ToolTipText     =   "Find Text"
  197.             ImageIndex      =   2
  198.          EndProperty
  199.       EndProperty
  200.    End
  201.    Begin MSComctlLib.StatusBar sbStatusBar 
  202.       Align           =   2  'Align Bottom
  203.       Height          =   270
  204.       Left            =   0
  205.       TabIndex        =   1
  206.       Top             =   4470
  207.       Width           =   7155
  208.       _ExtentX        =   12621
  209.       _ExtentY        =   476
  210.       _Version        =   393216
  211.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  212.          NumPanels       =   3
  213.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  214.             AutoSize        =   1
  215.             Object.Width           =   6959
  216.             Text            =   "Status"
  217.             TextSave        =   "Status"
  218.             Object.ToolTipText     =   "Status"
  219.          EndProperty
  220.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  221.             Style           =   6
  222.             AutoSize        =   2
  223.             TextSave        =   "11/22/2000"
  224.          EndProperty
  225.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  226.             Style           =   5
  227.             AutoSize        =   2
  228.             TextSave        =   "2:24 PM"
  229.          EndProperty
  230.       EndProperty
  231.    End
  232.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  233.       Left            =   4680
  234.       Top             =   480
  235.       _ExtentX        =   847
  236.       _ExtentY        =   847
  237.       _Version        =   393216
  238.    End
  239.    Begin MSComctlLib.ImageList imlToolbarIcons 
  240.       Left            =   3960
  241.       Top             =   480
  242.       _ExtentX        =   1005
  243.       _ExtentY        =   1005
  244.       BackColor       =   -2147483643
  245.       ImageWidth      =   16
  246.       ImageHeight     =   16
  247.       MaskColor       =   12632256
  248.       _Version        =   393216
  249.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  250.          NumListImages   =   15
  251.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  252.             Picture         =   "frmMain.frx":04FC
  253.             Key             =   "New"
  254.          EndProperty
  255.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  256.             Picture         =   "frmMain.frx":060E
  257.             Key             =   ""
  258.          EndProperty
  259.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  260.             Picture         =   "frmMain.frx":0726
  261.             Key             =   "Open"
  262.          EndProperty
  263.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  264.             Picture         =   "frmMain.frx":0838
  265.             Key             =   "Save"
  266.          EndProperty
  267.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  268.             Picture         =   "frmMain.frx":094A
  269.             Key             =   "Print"
  270.          EndProperty
  271.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  272.             Picture         =   "frmMain.frx":0A5C
  273.             Key             =   "Cut"
  274.          EndProperty
  275.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  276.             Picture         =   "frmMain.frx":0B6E
  277.             Key             =   "Copy"
  278.          EndProperty
  279.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  280.             Picture         =   "frmMain.frx":0C80
  281.             Key             =   "Paste"
  282.          EndProperty
  283.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  284.             Picture         =   "frmMain.frx":0D92
  285.             Key             =   "Bold"
  286.          EndProperty
  287.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  288.             Picture         =   "frmMain.frx":0EA4
  289.             Key             =   "Italic"
  290.          EndProperty
  291.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  292.             Picture         =   "frmMain.frx":0FB6
  293.             Key             =   "Underline"
  294.          EndProperty
  295.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  296.             Picture         =   "frmMain.frx":10C8
  297.             Key             =   "Align Left"
  298.          EndProperty
  299.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  300.             Picture         =   "frmMain.frx":11DA
  301.             Key             =   "Center"
  302.          EndProperty
  303.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  304.             Picture         =   "frmMain.frx":12EC
  305.             Key             =   "Align Right"
  306.          EndProperty
  307.          BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  308.             Picture         =   "frmMain.frx":13FE
  309.             Key             =   ""
  310.          EndProperty
  311.       EndProperty
  312.    End
  313.    Begin VB.Menu mnuFile 
  314.       Caption         =   "&File"
  315.       Begin VB.Menu mnuFileNew 
  316.          Caption         =   "&New"
  317.          Shortcut        =   ^N
  318.       End
  319.       Begin VB.Menu mnuFileOpen 
  320.          Caption         =   "&Open..."
  321.       End
  322.       Begin VB.Menu mnuFileBar0 
  323.          Caption         =   "-"
  324.       End
  325.       Begin VB.Menu mnuFileSave 
  326.          Caption         =   "&Save"
  327.       End
  328.       Begin VB.Menu mnuFileSaveAs 
  329.          Caption         =   "Save &As..."
  330.       End
  331.       Begin VB.Menu mnuFileBar1 
  332.          Caption         =   "-"
  333.       End
  334.       Begin VB.Menu mnuFilePrint 
  335.          Caption         =   "&Print..."
  336.       End
  337.       Begin VB.Menu mnuFileBar2 
  338.          Caption         =   "-"
  339.       End
  340.       Begin VB.Menu mnuFileExit 
  341.          Caption         =   "E&xit"
  342.       End
  343.    End
  344.    Begin VB.Menu mnuEdit 
  345.       Caption         =   "&Edit"
  346.       Begin VB.Menu mnuEditUndo 
  347.          Caption         =   "&Undo"
  348.       End
  349.       Begin VB.Menu mnuEditBar0 
  350.          Caption         =   "-"
  351.       End
  352.       Begin VB.Menu mnuEditCut 
  353.          Caption         =   "Cu&t        Ctrl+X"
  354.       End
  355.       Begin VB.Menu mnuEditCopy 
  356.          Caption         =   "&Copy     Ctrl+C"
  357.       End
  358.       Begin VB.Menu mnuEditPaste 
  359.          Caption         =   "&Paste    Ctrl+V"
  360.       End
  361.       Begin VB.Menu sep2 
  362.          Caption         =   "-"
  363.       End
  364.       Begin VB.Menu Selall 
  365.          Caption         =   "&Select All"
  366.       End
  367.       Begin VB.Menu sep1 
  368.          Caption         =   "-"
  369.       End
  370.       Begin VB.Menu Find 
  371.          Caption         =   "&Find"
  372.       End
  373.    End
  374.    Begin VB.Menu mnuView 
  375.       Caption         =   "&View"
  376.       Begin VB.Menu mnuViewToolbar 
  377.          Caption         =   "&Toolbar"
  378.          Checked         =   -1  'True
  379.       End
  380.       Begin VB.Menu mnuViewStatusBar 
  381.          Caption         =   "Status &Bar"
  382.          Checked         =   -1  'True
  383.       End
  384.       Begin VB.Menu mb 
  385.          Caption         =   "&Margin Bar"
  386.          Checked         =   -1  'True
  387.       End
  388.       Begin VB.Menu ml 
  389.          Caption         =   "&Margin Line"
  390.          Checked         =   -1  'True
  391.       End
  392.       Begin VB.Menu mnuViewBar0 
  393.          Caption         =   "-"
  394.       End
  395.       Begin VB.Menu mnuViewOptions 
  396.          Caption         =   "&Options..."
  397.       End
  398.       Begin VB.Menu sep3 
  399.          Caption         =   "-"
  400.       End
  401.       Begin VB.Menu refre 
  402.          Caption         =   "&Refresh"
  403.       End
  404.    End
  405.    Begin VB.Menu insert 
  406.       Caption         =   "&Insert"
  407.       Begin VB.Menu dt 
  408.          Caption         =   "&Date / Time"
  409.       End
  410.    End
  411.    Begin VB.Menu Format 
  412.       Caption         =   "&Format"
  413.       Begin VB.Menu style 
  414.          Caption         =   "&Style"
  415.          Begin VB.Menu bold 
  416.             Caption         =   "&Bold"
  417.          End
  418.          Begin VB.Menu italic 
  419.             Caption         =   "&Italic"
  420.          End
  421.          Begin VB.Menu Underline 
  422.             Caption         =   "&Underline"
  423.          End
  424.          Begin VB.Menu StrikeThru 
  425.             Caption         =   "&StrikeThru"
  426.          End
  427.          Begin VB.Menu bullets 
  428.             Caption         =   "&Bullets"
  429.          End
  430.       End
  431.       Begin VB.Menu Alignment 
  432.          Caption         =   "&Alignment"
  433.          Begin VB.Menu aLeft 
  434.             Caption         =   "&Left"
  435.          End
  436.          Begin VB.Menu aCenter 
  437.             Caption         =   "&Center"
  438.          End
  439.          Begin VB.Menu aRight 
  440.             Caption         =   "&Right"
  441.          End
  442.       End
  443.       Begin VB.Menu script 
  444.          Caption         =   "&Script"
  445.          Begin VB.Menu Nos 
  446.             Caption         =   "&No Scripting"
  447.          End
  448.          Begin VB.Menu sups 
  449.             Caption         =   "S&uper Script"
  450.          End
  451.          Begin VB.Menu subs 
  452.             Caption         =   "&Sub Script"
  453.          End
  454.       End
  455.       Begin VB.Menu clr 
  456.          Caption         =   "&Color"
  457.          Begin VB.Menu black 
  458.             Caption         =   "&Black"
  459.             Checked         =   -1  'True
  460.          End
  461.          Begin VB.Menu gray 
  462.             Caption         =   "&Gray"
  463.          End
  464.          Begin VB.Menu red 
  465.             Caption         =   "&Red"
  466.          End
  467.          Begin VB.Menu orange 
  468.             Caption         =   "&Orange"
  469.          End
  470.          Begin VB.Menu yellow 
  471.             Caption         =   "&Yellow"
  472.          End
  473.          Begin VB.Menu green 
  474.             Caption         =   "&Green"
  475.          End
  476.          Begin VB.Menu blue 
  477.             Caption         =   "&Blue"
  478.          End
  479.          Begin VB.Menu purple 
  480.             Caption         =   "&Purple"
  481.          End
  482.          Begin VB.Menu chngecolor 
  483.             Caption         =   "&Other..."
  484.          End
  485.       End
  486.       Begin VB.Menu cc 
  487.          Caption         =   "&Change Case"
  488.          Begin VB.Menu lc 
  489.             Caption         =   "&Lower Case"
  490.          End
  491.          Begin VB.Menu uc 
  492.             Caption         =   "&Upper Case"
  493.          End
  494.       End
  495.       Begin VB.Menu font 
  496.          Caption         =   "Set &Font"
  497.       End
  498.    End
  499. Attribute VB_Name = "frmMain"
  500. Attribute VB_GlobalNameSpace = False
  501. Attribute VB_Creatable = False
  502. Attribute VB_PredeclaredId = True
  503. Attribute VB_Exposed = False
  504. Dim SFile
  505. Dim Startupcomplete
  506. Dim mdpath
  507. Private Sub aCenter_Click()
  508. If aCenter.Checked = False Then
  509. Clearali
  510. aCenter.Checked = True
  511. tbToolBar.Buttons(16).Value = tbrPressed
  512. Rt.SelAlignment = 2
  513. sbStatusBar.Panels(1).Text = "Text Centered"
  514. Clearali
  515. aCenter.Checked = False
  516. tbToolBar.Buttons(16).Value = tbrUnpressed
  517. sbStatusBar.Panels(1).Text = "Text NOT Centered"
  518. End If
  519. End Sub
  520. Private Sub aLeft_Click()
  521. If aLeft.Checked = False Then
  522. Clearali
  523. Rt.SelAlignment = 0
  524. aLeft.Checked = True
  525. tbToolBar.Buttons(15).Value = tbrPressed
  526. sbStatusBar.Panels(1).Text = "Text Set Left"
  527. Clearali
  528. aLeft.Checked = False
  529. tbToolBar.Buttons(15).Value = tbrUnpressed
  530. sbStatusBar.Panels(1).Text = "Text NOT Set Left"
  531. End If
  532. End Sub
  533. Private Sub aRight_Click()
  534. If aRight.Checked = False Then
  535. Clearali
  536. aRight.Checked = True
  537. tbToolBar.Buttons(17).Value = tbrPressed
  538. Rt.SelAlignment = 1
  539. sbStatusBar.Panels(1).Text = "Text Set Right"
  540. Clearali
  541. aRight.Checked = False
  542. tbToolBar.Buttons(17).Value = tbrUnpressed
  543. sbStatusBar.Panels(1).Text = "Text NOT Set Right"
  544. End If
  545. End Sub
  546. Private Sub AutoSave_Timer()
  547. If Not frmMain.Caption = "Word 2001 - Untitled" Then
  548. mnuFileSave_Click
  549. End If
  550. sbStatusBar.Panels(1).Text = "File Auto Saved: " & Time
  551. End Sub
  552. Private Sub black_Click()
  553. ClearCChecks
  554. black.Checked = True
  555. Rt.SelColor = vbBlack
  556. sbStatusBar.Panels(1).Text = "Color set to black"
  557. End Sub
  558. Private Sub blue_Click()
  559. ClearCChecks
  560. black.Checked = True
  561. Rt.SelColor = vbBlue
  562. sbStatusBar.Panels(1).Text = "Color set to blue"
  563. End Sub
  564. Private Sub bold_Click()
  565. If bold.Checked = False Then
  566. bold.Checked = True
  567. Rt.SelBold = True
  568. tbToolBar.Buttons(11).Value = tbrPressed
  569. sbStatusBar.Panels(1).Text = "Style is Bold"
  570. tbToolBar.Buttons(11).Value = tbrUnpressed
  571. bold.Checked = False
  572. Rt.SelBold = False
  573. sbStatusBar.Panels(1).Text = "Style is NOT Bold"
  574. End If
  575. End Sub
  576. Private Sub bullets_Click()
  577. If bullets.Checked = False Then
  578. bullets.Checked = True
  579. Rt.SelBullet = True
  580. sbStatusBar.Panels(1).Text = "Bullets Enabled"
  581. bullets.Checked = False
  582. Rt.SelBullet = False
  583. sbStatusBar.Panels(1).Text = "Bullets Disabled"
  584. End If
  585. End Sub
  586. Private Sub chngecolor_Click()
  587. sbStatusBar.Panels(1).Text = "Select a color"
  588. On Error Resume Next
  589. dlgCommonDialog.Color = Rt.SelColor
  590. dlgCommonDialog.Flags = 1
  591. dlgCommonDialog.ShowColor
  592. Rt.SelColor = dlgCommonDialog.Color
  593. End Sub
  594. Private Sub Combo1_Click()
  595. sbStatusBar.Panels(1).Text = "Select a font"
  596. On Error Resume Next
  597. Rt.SelFontName = Combo1.Text
  598. If Startupcomplete = True Then
  599. Rt.SetFocus
  600. End If
  601. End Sub
  602. Private Sub Combo2_Click()
  603. sbStatusBar.Panels(1).Text = "Select a font size"
  604. On Error Resume Next
  605. Rt.SelFontSize = Combo2.Text
  606. If Startupcomplete = True Then
  607. Rt.SetFocus
  608. End If
  609. End Sub
  610. Private Sub Combo2_KeyPress(KeyAscii As Integer)
  611. sbStatusBar.Panels(1).Text = "Enter a size number (1 - 100000)"
  612. On Error Resume Next
  613. If KeyAscii = 13 Then
  614. Rt.SelFontSize = Combo2.Text
  615. End If
  616. End Sub
  617. Private Sub di_Click()
  618. Rt.SelIndent = Rt.SelIndent - 10
  619. Slider1.Value = Rt.SelIndent / 50
  620. End Sub
  621. Private Sub dt_Click()
  622. frmDt.Show
  623. End Sub
  624. Private Sub Find_Click()
  625. sbStatusBar.Panels(1).Text = "Find Text"
  626. FrmFind.Show
  627. End Sub
  628. Private Sub font_Click()
  629. sbStatusBar.Panels(1).Text = "Select a font"
  630. On Error Resume Next
  631. dlgCommonDialog.Flags = 1
  632. dlgCommonDialog.ShowFont
  633. Rt.SelFontName = dlgCommonDialog.FontName
  634. Rt.SelFontSize = dlgCommonDialog.FontSize
  635. Rt.SelUnderline = dlgCommonDialog.FontUnderline
  636. Rt.SelBold = dlgCommonDialog.FontBold
  637. Rt.SelItalic = dlgCommonDialog.FontItalic
  638. Rt.SelStrikeThru = dlgCommonDialog.FontStrikethru
  639. End Sub
  640. Private Sub Form_activate()
  641. On Error GoTo h:
  642. frmSplash.SetFocus
  643. If Startupcomplete = False Then
  644. LoadFonts
  645. End If
  646. Startupcomplete = True
  647. sbStatusBar.Panels(1).Text = "Status"
  648. End Sub
  649. Private Sub Form_Load()
  650. frmSplash.Show
  651. DoEvents
  652. Slider1.Value = 10
  653. curdrive = Mid(CurDir, 1, 3)
  654. mdpath = curdrive & "MyDocu~1\*.*"
  655. aLeft_Click
  656.     Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
  657.     Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
  658.     Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
  659.     Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
  660. sbStatusBar.Panels(1).Text = "Status"
  661. mnuFileNew_Click
  662. GetOptions
  663. End Sub
  664. Private Sub Form_Resize()
  665. On Error Resume Next
  666. If tbToolBar.Visible = True Then
  667. tbtb = tbToolBar.Height
  668. tbtb = 0
  669. End If
  670. If frmMain.Height < 3000 Then frmMain.Height = 3000
  671. If frmMain.Width < 6900 Then frmMain.Width = 6900
  672. Rt.Width = frmMain.Width - 100
  673. Combo1.Top = tbtb + 10
  674. Combo2.Top = Combo1.Top
  675. If sbStatusBar.Visible = True Then
  676. vvv = 1000
  677. vvv = 775
  678. End If
  679. If Slider1.Visible = True Then
  680. Rt.Top = tbtb + Combo1.Height + Slider1.Height + 100
  681. Rt.Height = frmMain.Height - (tbtb + vvv) - Combo1.Height - Slider1.Height
  682. Rt.Top = tbtb + Combo1.Height + 100
  683. Rt.Height = frmMain.Height - (tbtb + vvv) - Combo1.Height
  684. End If
  685. Slider1.Top = Combo1.Height + Combo1.Top
  686. Slider1.Width = Rt.Width
  687. Slider1.Left = Rt.Left
  688. Slider1.Max = Rt.Width / 50
  689. Slider1_Change
  690. End Sub
  691. Private Sub Form_Unload(Cancel As Integer)
  692. On Error Resume Next
  693. Unload frmSplash
  694. Dim i As Integer
  695. For i = Forms.Count - 1 To 1 Step -1
  696. Unload Forms(i)
  697. Next i
  698. If Me.WindowState <> vbMinimized And Me.WindowState <> vbMaximized Then
  699.     SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  700.     SaveSetting App.Title, "Settings", "MainTop", Me.Top
  701.     SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  702.     SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  703. End If
  704. End Sub
  705. Private Sub Format_Click()
  706. sbStatusBar.Panels(1).Text = "Format"
  707. clr_click
  708. alignment_click
  709. End Sub
  710. Private Sub gray_Click()
  711. sbStatusBar.Panels(1).Text = "Color set to gray"
  712. ClearCChecks
  713. black.Checked = True
  714. Rt.SelColor = &H808080
  715. End Sub
  716. Private Sub green_Click()
  717. sbStatusBar.Panels(1).Text = "Color set to green"
  718. ClearCChecks
  719. black.Checked = True
  720. Rt.SelColor = vbGreen
  721. End Sub
  722. Private Sub ii_Click()
  723. Rt.SelIndent = Rt.SelIndent + 10
  724. Slider1.Value = Rt.SelIndent / 50
  725. End Sub
  726. Private Sub italic_Click()
  727. If italic.Checked = False Then
  728. italic.Checked = True
  729. Rt.SelItalic = True
  730. tbToolBar.Buttons(12).Value = tbrPressed
  731. sbStatusBar.Panels(1).Text = "Style is Italic"
  732. tbToolBar.Buttons(12).Value = tbrUnpressed
  733. italic.Checked = False
  734. Rt.SelItalic = False
  735. sbStatusBar.Panels(1).Text = "Style is NOT Italic"
  736. End If
  737. End Sub
  738. Private Sub lc_Click()
  739. sbStatusBar.Panels(1).Text = "Selected text is now all lower case"
  740. Clipboard.SetText frmMain.Rt.SelText
  741. frmMain.Rt.SelText = LCase(Clipboard.GetText)
  742. End Sub
  743. Private Sub mb_Click()
  744. If mb.Checked = True Then
  745. Slider1.Visible = False
  746. sbStatusBar.Panels(1).Text = "Margin bar hidden"
  747. Form_Resize
  748. mb.Checked = False
  749. Slider1.Visible = True
  750. sbStatusBar.Panels(1).Text = "Margin bar shown"
  751. Form_Resize
  752. mb.Checked = True
  753. End If
  754. End Sub
  755. Private Sub ml_Click()
  756. If ml.Checked = True Then
  757. ml.Checked = False
  758. Marline.BackColor = Rt.BackColor
  759. sbStatusBar.Panels(1).Text = "Margin line hidden"
  760. ml.Checked = True
  761. Marline.BackColor = &H8000000F
  762. sbStatusBar.Panels(1).Text = "Margin line shown"
  763. End If
  764. End Sub
  765. Private Sub mnuFileSave_Click()
  766. If SFile = "" Then
  767. mnuFileSaveAs_Click
  768. GoTo ok:
  769. End If
  770. On Error GoTo jjj:
  771. Rt.SaveFile (SFile)
  772. GoTo ok:
  773. asdsd = MsgBox("There was an error in saving the file!", vbExclamation + vbOKOnly, "Error!")
  774. frmMain.Caption = "Word 2001 - " & SFile
  775. End Sub
  776. Private Sub Nos_Click()
  777. frmMain.Rt.SelCharOffset = 0
  778. End Sub
  779. Private Sub orange_Click()
  780. ClearCChecks
  781. black.Checked = True
  782. Rt.SelColor = &H80FF&
  783. sbStatusBar.Panels(1).Text = "Color set to orange"
  784. End Sub
  785. Private Sub purple_Click()
  786. ClearCChecks
  787. black.Checked = True
  788. Rt.SelColor = &HFF00FF
  789. sbStatusBar.Panels(1).Text = "Color set to purple"
  790. End Sub
  791. Private Sub red_Click()
  792. ClearCChecks
  793. black.Checked = True
  794. Rt.SelColor = vbRed
  795. sbStatusBar.Panels(1).Text = "Color set to red"
  796. End Sub
  797. Private Sub refre_Click()
  798. sbStatusBar.Panels(1).Text = "Refreshing..."
  799. RefreshRt
  800. End Sub
  801. Private Sub Rt_Click()
  802. chngesub
  803. End Sub
  804. Private Sub Rt_KeyDown(KeyCode As Integer, Shift As Integer)
  805. If KeyCode = 116 Then
  806. sbStatusBar.Panels(1).Text = "Refreshing..."
  807. RefreshRt
  808. End If
  809. End Sub
  810. Private Sub Rt_KeyUp(KeyCode As Integer, Shift As Integer)
  811. chngesub
  812. End Sub
  813. Private Sub Selall_Click()
  814. sbStatusBar.Panels(1).Text = "Selected all"
  815. Rt.SetFocus
  816. SendKeys ("^{a}")
  817. End Sub
  818. Private Sub Slider1_Change()
  819. sbStatusBar.Panels(1).Text = "Margins have been changed"
  820. On Error Resume Next
  821. If Slider1.Value > Slider1.Max / 1.5 Then Slider1.Value = Slider1.Max / 1.5
  822. Marline.Visible = True
  823. Rt.SelStart = 0
  824. Rt.SelLength = Len(Rt.Text)
  825. Rt.SelIndent = (Slider1.Value * 48.5)
  826. Marline.Height = Rt.Height - 100
  827. Marline.Left = Rt.SelIndent + 100
  828. Marline.Top = Rt.Top + 50
  829. Rt.SelIndent = Rt.SelIndent + 100
  830. Rt.SelLength = 0
  831. If Startupcomplete = True Then
  832. Rt.SetFocus
  833. End If
  834. End Sub
  835. Private Sub StrikeThru_Click()
  836. If StrikeThru.Checked = False Then
  837. StrikeThru.Checked = True
  838. Rt.SelStrikeThru = True
  839. sbStatusBar.Panels(1).Text = "Style is Strikthru"
  840. StrikeThru.Checked = False
  841. Rt.SelStrikeThru = False
  842. sbStatusBar.Panels(1).Text = "Style is NOT Strikthru"
  843. End If
  844. End Sub
  845. Private Sub subs_Click()
  846. frmMain.Rt.SelCharOffset = -55
  847. End Sub
  848. Private Sub sups_Click()
  849. sbStatusBar.Panels(1).Text = "Superscript"
  850. frmMain.Rt.SelCharOffset = 55
  851. End Sub
  852. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComCtlLib.Button)
  853.     On Error Resume Next
  854.     Select Case Button.Key
  855.         Case "Find"
  856.         Find_Click
  857.         Case "Color"
  858.         PopupMenu clr, , Button.Left, Button.Top + Button.Height
  859.         Case "New"
  860.         mnuFileNew_Click
  861.         Case "Open"
  862.             mnuFileOpen_Click
  863.         Case "Save"
  864.             mnuFileSave_Click
  865.         Case "Print"
  866.             mnuFilePrint_Click
  867.         Case "Cut"
  868.             mnuEditCut_Click
  869.         Case "Copy"
  870.             mnuEditCopy_Click
  871.         Case "Paste"
  872.             mnuEditPaste_Click
  873.         Case "Bold"
  874. bold_Click
  875.         Case "Italic"
  876. italic_Click
  877.         Case "Underline"
  878. Underline_Click
  879.         Case "Align Left"
  880. aLeft_Click
  881.         Case "Center"
  882. aCenter_Click
  883.         Case "Align Right"
  884. aRight_Click
  885.     End Select
  886. End Sub
  887. Private Sub mnuViewOptions_Click()
  888. sbStatusBar.Panels(1).Text = "Options"
  889. FrmOptions.Show
  890. End Sub
  891. Private Sub mnuViewStatusBar_Click()
  892.     mnuViewStatusBar.Checked = Not mnuViewStatusBar.Checked
  893.     sbStatusBar.Visible = mnuViewStatusBar.Checked
  894. Form_Resize
  895. End Sub
  896. Private Sub mnuViewToolbar_Click()
  897.     mnuViewToolbar.Checked = Not mnuViewToolbar.Checked
  898.     tbToolBar.Visible = mnuViewToolbar.Checked
  899.     Form_Resize
  900. End Sub
  901. Private Sub mnuEditPaste_Click()
  902. sbStatusBar.Panels(1).Text = "Clipboard pasted"
  903. Rt.SetFocus
  904. SendKeys "^{v}"
  905. End Sub
  906. Private Sub mnuEditCopy_Click()
  907. sbStatusBar.Panels(1).Text = "Selected text sent to clipboard"
  908. Rt.SetFocus
  909. SendKeys "^{c}"
  910. End Sub
  911. Private Sub mnuEditCut_Click()
  912. sbStatusBar.Panels(1).Text = "Selected text sent to clipboard"
  913. Rt.SetFocus
  914. SendKeys "^{x}"
  915. End Sub
  916. Private Sub mnuEditUndo_Click()
  917. Rt.SetFocus
  918. SendKeys "^{z}"
  919. End Sub
  920. Private Sub mnuFileExit_Click()
  921. sbStatusBar.Panels(1).Text = "goodbye!"
  922. Unload Me
  923. End Sub
  924. Private Sub mnuFilePrint_Click()
  925. sbStatusBar.Panels(1).Text = "Printing..."
  926. Askprint.Show
  927. End Sub
  928. Private Sub mnuFilePageSetup_Click()
  929.     sbStatusBar.Panels(1).Text = "Page setup"
  930.     On Error Resume Next
  931.     With dlgCommonDialog
  932.         .DialogTitle = "Page Setup"
  933.         .CancelError = True
  934.         .ShowPrinter
  935.     End With
  936. End Sub
  937. Private Sub mnuFilePrintPreview_Click()
  938. sbStatusBar.Panels(1).Text = "Print Preview"
  939.     'ToDo: Add 'mnuFilePrintPreview_Click' code.
  940.     MsgBox "Add 'mnuFilePrintPreview_Click' code."
  941. End Sub
  942. Private Sub mnuFileSaveAs_Click()
  943. sbStatusBar.Panels(1).Text = "Save As..."
  944. On Error GoTo ghj:
  945. dlgCommonDialog.Flags = 1
  946. dlgCommonDialog.Filter = "Word for Windows 6.0|*.doc"
  947. dlgCommonDialog.ShowSave
  948. If dlgCommonDialog.FileName = "" Then GoTo h:
  949. Rt.SaveFile (dlgCommonDialog.FileName)
  950. SFile = dlgCommonDialog.FileName
  951. frmMain.Caption = "Word 2001 - " & SFile
  952. GoTo h2:
  953. nul = MsgBox("Error in saving file!", vbExclamation + vbOKOnly, "Error!")
  954. End Sub
  955. Private Sub mnuFileOpen_Click()
  956. sbStatusBar.Panels(1).Text = "Open File..."
  957. Dim SFile As String
  958.     With dlgCommonDialog
  959.         .DialogTitle = "Pick a File to Open"
  960.         .CancelError = False
  961.         .Flags = 1
  962.         .Filter = "All Files (*.*)|*.*"
  963.         .ShowOpen
  964.         If Len(.FileName) = 0 Then
  965.             Exit Sub
  966.         End If
  967.     End With
  968. SFile = dlgCommonDialog.FileName
  969. Rt.LoadFile (SFile)
  970. frmMain.Caption = "Word 2001 - " & SFile
  971. Form_Resize
  972. End Sub
  973. Private Sub mnuFileNew_Click()
  974. frmMain.Caption = "Word 2001 - Untitled"
  975. With Rt
  976. .Text = ""
  977. .SelAlignment = 0
  978. .FileName = ""
  979. .SelFontName = "Times New Romans"
  980. .SelBold = False
  981. .SelBullet = False
  982. .SelColor = vbBlack
  983. .SelFontSize = 10
  984. .SelItalic = False
  985. .SelRightIndent = False
  986. .SelStrikeThru = False
  987. .SelUnderline = False
  988. .SelCharOffset = 0
  989. End With
  990. RefreshRt
  991. End Sub
  992. Private Sub Timer1_Timer()
  993. Unload frmSplash
  994. Timer1.Enabled = False
  995. End Sub
  996. Private Sub uc_Click()
  997. sbStatusBar.Panels(1).Text = "Selected text now all upper case"
  998. Clipboard.SetText frmMain.Rt.SelText
  999. frmMain.Rt.SelText = UCase(Clipboard.GetText)
  1000. End Sub
  1001. Private Sub Underline_Click()
  1002. If Underline.Checked = False Then
  1003. Underline.Checked = True
  1004. Rt.SelUnderline = True
  1005. tbToolBar.Buttons(13).Value = tbrPressed
  1006. sbStatusBar.Panels(1).Text = "Style is underline"
  1007. tbToolBar.Buttons(13).Value = tbrUnpressed
  1008. Underline.Checked = False
  1009. Rt.SelUnderline = False
  1010. sbStatusBar.Panels(1).Text = "Style is NOT underline"
  1011. End If
  1012. End Sub
  1013. Private Sub style_click()
  1014. If Rt.SelUnderline = True Then
  1015. Underline.Checked = True
  1016. Underline.Checked = False
  1017. End If
  1018. If Rt.SelItalic = True Then
  1019. italic.Checked = True
  1020. italic.Checked = False
  1021. End If
  1022. If Rt.SelBold = True Then
  1023. bold.Checked = True
  1024. bold.Checked = False
  1025. End If
  1026. If Rt.SelStrikeThru = True Then
  1027. StrikeThru.Checked = True
  1028. StrikeThru.Checked = False
  1029. End If
  1030. If Rt.SelBullet = True Then
  1031. bullets.Checked = True
  1032. bullets.Checked = False
  1033. End If
  1034. End Sub
  1035. Private Sub LoadFonts()
  1036. On Error Resume Next
  1037. Combo1.Clear
  1038. Combo2.Clear
  1039. sbStatusBar.Panels(1).Text = "Loading Fonts..."
  1040. For i = 0 To Screen.FontCount - 1
  1041. Combo1.AddItem (Screen.Fonts(i))
  1042. DoEvents
  1043. Next i
  1044. DoEvents
  1045. sbStatusBar.Panels(1).Text = "Loading Loaded."
  1046. For i = 1 To 100
  1047. Combo2.AddItem (i)
  1048. Next i
  1049. Combo2.Text = 10
  1050. Combo1.Text = "Times New Roman"
  1051. End Sub
  1052. Private Sub ClearCChecks()
  1053. black.Checked = False
  1054. gray.Checked = False
  1055. red.Checked = False
  1056. orange.Checked = False
  1057. yellow.Checked = False
  1058. green.Checked = False
  1059. blue.Checked = False
  1060. purple.Checked = False
  1061. End Sub
  1062. Private Sub yellow_Click()
  1063. ClearCChecks
  1064. black.Checked = True
  1065. Rt.SelColor = vbYellow
  1066. sbStatusBar.Panels(1).Text = "Color set to yellow"
  1067. End Sub
  1068. Private Sub clr_click()
  1069. ClearCChecks
  1070. Select Case Rt.SelColor
  1071. Case vbBlack
  1072. black.Checked = True
  1073. Case &H808080
  1074. gray.Checked = True
  1075. Case vbRed
  1076. red.Checked = True
  1077. Case &H80FF&
  1078. orange.Checked = True
  1079. Case vbYellow
  1080. yellow.Checked = True
  1081. Case vbGreen
  1082. green.Checked = True
  1083. Case vbBlue
  1084. blue.Checked = True
  1085. Case &HFF00FF
  1086. purple.Checked = True
  1087. End Select
  1088. End Sub
  1089. Private Sub Clearali()
  1090. tbToolBar.Buttons(15).Value = tbrUnpressed
  1091. tbToolBar.Buttons(16).Value = tbrUnpressed
  1092. tbToolBar.Buttons(17).Value = tbrUnpressed
  1093. aLeft.Checked = False
  1094. aCenter.Checked = False
  1095. aRight.Checked = False
  1096. End Sub
  1097. Private Sub alignment_click()
  1098. Clearali
  1099. Select Case Rt.SelAlignment
  1100. Case 0
  1101. aLeft.Checked = True
  1102. tbToolBar.Buttons(15).Value = tbrPressed
  1103. Case 1
  1104. aRight.Checked = True
  1105. tbToolBar.Buttons(17).Value = tbrPressed
  1106. Case 2
  1107. aCenter.Checked = True
  1108. tbToolBar.Buttons(16).Value = tbrPressed
  1109. End Select
  1110. End Sub
  1111. Private Sub chngesub()
  1112. Static amt
  1113. Static lamt
  1114. amt = Rt.SelAlignment
  1115. If amt <> lamt Then
  1116. alignment_click
  1117. End If
  1118. lamt = Rt.SelAlignment
  1119. If Rt.SelBold = True Then
  1120. bold.Checked = True
  1121. tbToolBar.Buttons(11).Value = tbrPressed
  1122. bold.Checked = False
  1123. tbToolBar.Buttons(11).Value = tbrUnpressed
  1124. End If
  1125. If Rt.SelItalic = True Then
  1126. italic.Checked = True
  1127. tbToolBar.Buttons(12).Value = tbrPressed
  1128. italic.Checked = False
  1129. tbToolBar.Buttons(12).Value = tbrUnpressed
  1130. End If
  1131. If Rt.SelUnderline = True Then
  1132. Underline.Checked = True
  1133. tbToolBar.Buttons(13).Value = tbrPressed
  1134. Underline.Checked = False
  1135. tbToolBar.Buttons(13).Value = tbrUnpressed
  1136. End If
  1137. End Sub
  1138. Private Sub RefreshRt()
  1139. sbStatusBar.Panels(1).Text = "Refreshing..."
  1140. DoEvents
  1141. Format_Click
  1142. DoEvents
  1143. Combo1.Refresh
  1144. DoEvents
  1145. Combo2.Refresh
  1146. DoEvents
  1147. tbToolBar.Refresh
  1148. DoEvents
  1149. frmMain.Refresh
  1150. DoEvents
  1151. frmMain.Cls
  1152. DoEvents
  1153. Rt.Refresh
  1154. DoEvents
  1155. LoadFonts
  1156. DoEvents
  1157. sbStatusBar.Panels(1).Text = "Status"
  1158. GetOptions
  1159. End Sub
  1160. Private Sub IND(amount)
  1161. Rt.SelIndent = amount
  1162. End Sub
  1163. Private Sub GetOptions()
  1164. On Error GoTo hhh:
  1165. a = Mid(CurDir, 1, 3)
  1166. a = a & "windows\"
  1167. Open a & "Word2001.dat" For Input As #1
  1168. Input #1, a, b, c
  1169. Close #1
  1170. If a = True Then
  1171. 'No autosave
  1172. AutoSave.Enabled = False
  1173. AutoSave.Enabled = True
  1174. Select Case c
  1175. Case "Second(s)"
  1176. AutoSave.Interval = b * 1000
  1177. Case "Minute(s)"
  1178. AutoSave.Interval = b * 60000
  1179. Case Else
  1180. 'File corrupt or something
  1181. AutoSave.Enabled = False
  1182. End Select
  1183. End If
  1184. Me.SetFocus
  1185. End Sub
  1186.