home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD14474232001.psc / VBSnipletKeeper / Form3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-01-31  |  3.1 KB  |  96 lines

  1. VERSION 5.00
  2. Begin VB.Form Form3 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Extract Tip"
  5.    ClientHeight    =   2040
  6.    ClientLeft      =   45
  7.    ClientTop       =   285
  8.    ClientWidth     =   4590
  9.    LinkTopic       =   "Form3"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2040
  13.    ScaleWidth      =   4590
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton Command2 
  17.       Caption         =   "&Cancel"
  18.       Height          =   350
  19.       Left            =   1200
  20.       TabIndex        =   2
  21.       Top             =   1530
  22.       Width           =   1125
  23.    End
  24.    Begin VB.CommandButton Command1 
  25.       Caption         =   "&Extarct"
  26.       Height          =   350
  27.       Left            =   30
  28.       TabIndex        =   1
  29.       Top             =   1530
  30.       Width           =   1125
  31.    End
  32.    Begin VB.Frame Frame1 
  33.       Height          =   1380
  34.       Left            =   30
  35.       TabIndex        =   0
  36.       Top             =   15
  37.       Width           =   4425
  38.       Begin VB.OptionButton OptBas 
  39.          Caption         =   "Extract as Visual Basic Module"
  40.          Height          =   270
  41.          Left            =   120
  42.          TabIndex        =   4
  43.          Top             =   570
  44.          Width           =   4005
  45.       End
  46.       Begin VB.OptionButton OptText 
  47.          Caption         =   "Extract as Text Document"
  48.          Height          =   270
  49.          Left            =   120
  50.          TabIndex        =   3
  51.          Top             =   270
  52.          Width           =   4005
  53.       End
  54.    End
  55. Attribute VB_Name = "Form3"
  56. Attribute VB_GlobalNameSpace = False
  57. Attribute VB_Creatable = False
  58. Attribute VB_PredeclaredId = True
  59. Attribute VB_Exposed = False
  60. Dim mPath As String
  61. Private Sub Command1_Click()
  62. Dim File1, File2 As Long
  63.     File1 = FreeFile
  64.     File2 = FreeFile
  65.     mPath = AddBackSlash(mPath)
  66.     If OptText Then
  67.         Open mPath & Extra & ".txt" For Output As #File1
  68.             Print #File1, , Form1.txtCodeMain.Text
  69.         Close #File1
  70.         '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  71.         MsgBox "Your tip has been saved to " & mPath & Extra
  72.         Unload Form3: Form1.Show
  73.         ElseIf OptBas Then
  74.             Open mPath & Extra & ".bas" For Output As #File2
  75.                 Print #File2, , "Attribute VB_Name = " & Chr(34) & "Module1" & Chr(34)
  76.                 Print #File2, , Form1.txtCodeMain.Text
  77.             Close #hfile
  78.         '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  79.         MsgBox "Your tip has been saved to " & mPath & Extra
  80.         Unload Form3: Form1.Show
  81.         Exit Sub
  82.     Else
  83.         MsgBox "You must select a extract option", vbInformation
  84.     End If
  85. End Sub
  86. Private Sub Command2_Click()
  87.     Unload Form3
  88.     Form1.Show
  89. End Sub
  90. Private Sub Form_Load()
  91.     If FolderExists(AddBackSlash(App.Path) & "Tips") = 0 Then
  92.         MkDir AddBackSlash(App.Path) & "Tips"
  93.     End If
  94.     mPath = AddBackSlash(App.Path) & "Tips"
  95. End Sub
  96.