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
< prev
next >
Wrap
Text File
|
1995-08-12
|
2KB
|
80 lines
VERSION 4.00
Begin VB.Form Form1
Caption = "Test WordArt Automation"
ClientHeight = 2556
ClientLeft = 1140
ClientTop = 1548
ClientWidth = 4428
Height = 2880
Left = 1092
LinkTopic = "Form1"
ScaleHeight = 2556
ScaleWidth = 4428
Top = 1272
Width = 4524
Begin VB.CommandButton cmdRotate
Caption = "Rotate"
Height = 375
Left = 2520
TabIndex = 2
Top = 2040
Width = 1455
End
Begin VB.CommandButton cmdInsertText
Caption = "Insert Text"
Height = 375
Left = 2520
TabIndex = 1
Top = 1560
Width = 1455
End
Begin VB.OLE OLE1
Class = "MSWordArt.2"
Height = 1095
Left = 720
OleObjectBlob = "TEST.frx":0000
TabIndex = 0
Top = 360
Width = 3255
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdRotate_Click()
' Create a new object variable.
Dim oleWordArt As Object
' Set the object variable to the VB
' WordArt.Application class created to
' make WordArt programmable.
Set oleWordArt = GetObject("", "wordart.application")
' Rotate the object
oleWordArt.Rotate OLE1, 45
' Insert the WordArt object into an OLE
' control on the current form.
'Set OLE1 = oleWordArt.Object
End Sub
Private Sub cmdInsertText_Click()
' Create a new object variable.
Dim oleWordArt As Object
' Set the object variable to the VB
' WordArt.Application class created to
' make WordArt programmable.
Dim strText As String
strText = InputBox("Text to insert:")
' You must compile and register WORDART.VBP
' before the following line will work.
Set oleWordArt = GetObject("", "wordart.application")
' Use the InsertText method from WordArt.Application.
oleWordArt.InsertText strText
' Insert the WordArt object into an OLE
' control on the current form.
oleWordArt.CopyObject
OLE1.Paste
End Sub