home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH14 / 14-1-2.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-10-02  |  1.1 KB  |  38 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "EXAMPLE 2"
  4.    ClientHeight    =   1008
  5.    ClientLeft      =   1092
  6.    ClientTop       =   1512
  7.    ClientWidth     =   3324
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   1008
  11.    ScaleWidth      =   3324
  12.    Begin VB.CommandButton cmdCreate 
  13.       Caption         =   "&Create Word Document"
  14.       Height          =   495
  15.       Left            =   360
  16.       TabIndex        =   0
  17.       Top             =   240
  18.       Width           =   2415
  19.    End
  20. Attribute VB_Name = "Form1"
  21. Attribute VB_GlobalNameSpace = False
  22. Attribute VB_Creatable = False
  23. Attribute VB_PredeclaredId = True
  24. Attribute VB_Exposed = False
  25. Private Sub cmdCreate_Click()
  26.   Dim objWord As Object
  27.   Set objWord = CreateObject("Word.Basic")
  28.   objWord.FileNewDefault
  29.   objWord.Insert "I can resist anything."
  30.   objWord.Wordleft
  31.   objWord.Bold
  32.   objWord.Insert ", except temptation"
  33.   objWord.FilePrint    'Make sure your printer is on
  34.   objWord.FileSaveAs App.Path & "\QUOTE.DOC"
  35.   objWord.FileClose
  36.   Set objWord = Nothing
  37. End Sub
  38.