Skip to main content
Inspiring
April 7, 2012
Question

Adding Graphic Styles using VBA

  • April 7, 2012
  • 1 reply
  • 1080 views

Hi all

How would I go about applying graphic styles to a path using VBA? I would imagine the following line is wrong because it doesn't work.Any help would be appreciated.

idoc.GraphicStyles("02-S").ApplyTo (isquare2)

This topic has been closed for replies.

1 reply

Inspiring
April 7, 2012

I just found the sdk for it. i'll try and figure it out from there, hopefully I can. thanks

CarlosCanto
Community Expert
Community Expert
April 8, 2012

do you get Object doesn't support this property or method (Error 438) ?

try to figure it out, post back if you need help, it's no fun if I give you all the answers, right?

Inspiring
April 8, 2012

You're right, it is no fun to have someone give you all the answers. Trial and error is how I learn the most, well it least to make it stick.  Believe me, I go online and try out different things before posting anything on here. Along the way, I might not find the answer I'm looking for, but I always find something out, and most of the time, it's something I needed a while back.

Yep, I've seen that error quite a few times on numerous projects, it means that the object isn't affected by the methods or properties I'm trying to affect it with.

However, I was able to make it work by removing the () from the object variable isquare2.

idoc.GraphicStyles("02-S").ApplyTo isquare2

Thanks for the challenge Carlos!