I am porting some PowerPoint VBA macros into C# inside a VSTO add-on which automate certain tasks.
The macros were written for PP 2003 and I’m writing the VSTO add-on with PP 2010 as a target. The macros make heavy use of AutoShape-manipulation through the AutoShape.Adjustments object.
In VBA under 2003 i would access the X-Axis position of the “line-target” of a Legend-with-Line autoshape like this:
shape.Adjustments.Item(1) = someFloat
In c#/VSTO this seems to have changed to
shape.Adjustments[6] = someFloat;
There is now .Item collection in c#/VSTO.
Does anyone know where these values are documented, and most importantly, where they are documented for 2010?
Or is this all caused by switching to VSTO? If so, why would they choose to have you use different index numbers?
For now i’m stuck to manually test every Adjustments index in C# one after the other until i find the one that corresponds to the target in VBA.
I’ve never run across any documentation that explains what the various adjustments do and which shapes they apply to.
As to the difference in indexing/syntax, a wild guess:
In VBA, Shape.Adjustments.Item(x) and Shape.Adjustments(x) are equivalent; the default property for Adjustments (as with most collections) is .Item, so it’s not strictly necessary to explicitly use it.
Perhaps in .NET, you index into all of the Adjustments properties, since (as I understand it) there’s no longer a default/implicit property. In other words, perhaps what you’re seeing is an offset that will be consistent for all shapes.