Working with some stuff in Word 2010 and the VBA seems a wee bit different than what I'm used to in Excel.
I'm trying to access a bunch of objects to change the width/height.
There's around a thousand of them. Radio buttons copied from a web survey. I want them a bit smaller to make it all compacter in the Word document. They don't need to work, I just need to recreate the survey visually for an appendix.
The following two examples allows me to change the properties for DefaultOcxName995 and DefaultOcxName5 respectively.
But how could I access them with a variable object name? Like I said there's something like a thousand of them.
They seem to belong to the ThisDocument.InLineshapes (the .Count matches) and I thought would be accessible with ThisDocument.InLineshapes(index) but that does not seem to work.
Trying to do a loop to run through them all but I can't get either a "for each" or "for x to y" loop working because I can't seem to be able to access them in any way.
Not sure if it matters but they are nested inside tables in the word doc (for layout reasons).
I was looking at this in Word 2003 (at home) as well, and here they are simply images, if anyone knows how I could access it that way instead.
I'm trying to access a bunch of objects to change the width/height.
There's around a thousand of them. Radio buttons copied from a web survey. I want them a bit smaller to make it all compacter in the Word document. They don't need to work, I just need to recreate the survey visually for an appendix.
The following two examples allows me to change the properties for DefaultOcxName995 and DefaultOcxName5 respectively.
Code:
ThisDocument.DefaultOcxName995.Width = 11.7
ThisDocument.DefaultOcxName995.Height = 11.7
ThisDocument.DefaultOcxName5.Width = 11.7
ThisDocument.DefaultOcxName5.Height = 11.7
But how could I access them with a variable object name? Like I said there's something like a thousand of them.
They seem to belong to the ThisDocument.InLineshapes (the .Count matches) and I thought would be accessible with ThisDocument.InLineshapes(index) but that does not seem to work.
Trying to do a loop to run through them all but I can't get either a "for each" or "for x to y" loop working because I can't seem to be able to access them in any way.
Not sure if it matters but they are nested inside tables in the word doc (for layout reasons).
I was looking at this in Word 2003 (at home) as well, and here they are simply images, if anyone knows how I could access it that way instead.
Last edited: