Private Sub Command1_Click() Dim appRef As New Illustrator.Application Dim docRef As Illustrator.Document Dim textRef As Illustrator.TextArtItem Dim pathRef As Illustrator.PathItem Dim i As Integer Dim datasetRef As Illustrator.DataSet Dim visibilityVar As Illustrator.Variable Dim textVar As Illustrator.Variable Set docRef = appRef.Documents.Add() Set textRef = docRef.TextArtItems.Add() textRef.Position = Array(100, 400) textRef.Contents = "Visible" Set textVar = docRef.Variables.Add() textRef.ContentVariable = textVar Set pathRef = docRef.PathItems.Rectangle(450, 300, 100, 100) docRef.ArtStyles(8).ApplyTo pathRef.PageItem Set visibilityVar = docRef.Variables.Add() pathRef.VisibilityVariable = visibilityVar docRef.SaveAs ("C:\DS_V.ai") i = 1 Do While (i < 11) If ((i Mod 2) = 0) Then textRef.Contents = "Hidden" pathRef.Hidden = True Else textRef.Contents = "Visible" pathRef.Hidden = False End If Set datasetRef = docRef.DataSets.Add() i = i + 1 Loop docRef.ExportVariables ("C:\DS_V.xml") docRef.Close aiDoNotSaveChanges Set docRef = appRef.Open("C:\DS_V.ai") docRef.ImportVariables ("C:\DS_V.xml") End Sub