VB: Assigning a Boolean Property in Adobe Illustrator, Photoshop

While automating Adobe Illustrator CS3 using VBA, I found that assigning a boolean variable to a boolean property results in a permanent assignment of False:

Dim New_Path As Illustrator.PathItem
Dim v As Boolean
' ...
v = True
New_Path.Filled = v     ' ERROR: New_Path.Filled is False
v = False
New_Path.Filled = v     ' New_Path.Filled remains False

      

The constant assignment works fine:

Dim New_Path As Illustrator.PathItem
' ...
New_Path.Filled = True  ' New_Path.Filled is True
New_Path.Filled = False ' New_Path.Filled is False

      

Checked for various AI booleans like PathItem.Stroked

, Layer.Visible

etc.

Confirmed for Photoshop.ArtLayer.Visible

.

Confirmed for VB6.

So, I believe this behavior is common for Adobe Adobe Creative Suite products.

Is this a bug or a feature?

+3


source to share


1 answer


Wrap the variable v

with CBool()

function
.



+6


source







All Articles