Discussion Area

ask questions, discuss topics, solve problems

This is a public Discussion Area  publicRSS

Thread

    • Help needed with Visual Basic coding for...
      Thread posted Mar 15 by VaiVedrai
      572 Views, 1 Comment
      Title:
      Help needed with Visual Basic coding for Illustrator CS3
      Content:

      I am using Visual Basic 2008 Express Edition and when I try the following code get the error message "Array is a type and cannot be used as an expression."

      What am I doing wrong?

       

       

       

       

       

       

       

       

       

       

       

       

      Public

      Class Form1

       

       

      Dim appRef As Illustrator.Application

       

       

      Dim documentRef As Illustrator.Document

       

       

      Dim sampleText As Illustrator.TextFrame

       

       

      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

      appRef = CreateObject(

      "Illustrator.Application")

       

       

      REM Create a new document and assign it to a variable

      documentRef = appRef.Documents.Add

       

       

      REM Create a new text frame item and assign it to a variable

      sampleText = documentRef.TextFrames.Add

       

       

      REM Set the contents and position of the TextFrame

      sampleText.Position = Array(200, 200)

      sampleText.Contents =

      "Hello World!"

       

       

      End Sub

      End

      Class

    Comments

    • Val, you may want to post this on the Illustrator Forum under the Scripting section -- there's likley to be greater visibility there:

      http://www.adobeforums.com/cgi-bin/webx?14@@.3bb50db0