home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch15code / test.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-12  |  2.4 KB  |  75 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Test WordArt Automation"
  4.    ClientHeight    =   2556
  5.    ClientLeft      =   1140
  6.    ClientTop       =   1548
  7.    ClientWidth     =   4428
  8.    Height          =   2880
  9.    Left            =   1092
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2556
  12.    ScaleWidth      =   4428
  13.    Top             =   1272
  14.    Width           =   4524
  15.    Begin VB.CommandButton cmdRotate 
  16.       Caption         =   "Rotate"
  17.       Height          =   375
  18.       Left            =   2520
  19.       TabIndex        =   2
  20.       Top             =   2040
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton cmdInsertText 
  24.       Caption         =   "Insert Text"
  25.       Height          =   375
  26.       Left            =   2520
  27.       TabIndex        =   1
  28.       Top             =   1560
  29.       Width           =   1455
  30.    End
  31.    Begin VB.OLE OLE1 
  32.       Class           =   "MSWordArt.2"
  33.       Height          =   1095
  34.       Left            =   720
  35.       OleObjectBlob   =   "TEST.frx":0000
  36.       TabIndex        =   0
  37.       Top             =   360
  38.       Width           =   3255
  39.    End
  40. Attribute VB_Name = "Form1"
  41. Attribute VB_Creatable = False
  42. Attribute VB_Exposed = False
  43. Option Explicit
  44. Private Sub cmdRotate_Click()
  45.     ' Create a new object variable.
  46.     Dim oleWordArt As Object
  47.     ' Set the object variable to the VB
  48.     ' WordArt.Application class created to
  49.     ' make WordArt programmable.
  50.     Set oleWordArt = GetObject("", "wordart.application")
  51.     ' Rotate the object
  52.     oleWordArt.Rotate OLE1, 45
  53.     ' Insert the WordArt object into an OLE
  54.     ' control on the current form.
  55.     'Set OLE1 = oleWordArt.Object
  56. End Sub
  57. Private Sub cmdInsertText_Click()
  58.     ' Create a new object variable.
  59.     Dim oleWordArt As Object
  60.     ' Set the object variable to the VB
  61.     ' WordArt.Application class created to
  62.     ' make WordArt programmable.
  63.     Dim strText As String
  64.     strText = InputBox("Text to insert:")
  65.     ' You must compile and register WORDART.VBP
  66.     ' before the following line will work.
  67.     Set oleWordArt = GetObject("", "wordart.application")
  68.     ' Use the InsertText method from WordArt.Application.
  69.     oleWordArt.InsertText strText
  70.     ' Insert the WordArt object into an OLE
  71.     ' control on the current form.
  72.     oleWordArt.CopyObject
  73.     OLE1.Paste
  74. End Sub
  75.