I'm building a lengthy MSWord Document with numerous activeX comboboxes on it.
There are a number of combo boxes which need to be populated with the same information, therefore I want to be able to give these a naming convention i.e. country1 country2 etc and then be able to iterise through a collection to populate the combox box with the same info. This will be run on open. Also as the document is dynamic, so on intial editing some of these comboboxes may be deleted prior to saving and closing. To ensure that when the document is open subsequently that no errors occur and if statement is also needed to check that the combobox exists before trying to populate the boxes.
Given that the collections tend work on indexes. I was going to count the collection then iterise through the collection checking to see if a trimmed name match occurs and if so then populate. However it all seems to fail for me. Below is my code..
dim i as integer
dim shapesCount as integer
dim name as string
dim fullName as string
shapesCount = ActiveDocument.InlineShapes.Count
let i = 1
name = left(ActiveDocument.InlineShapes(i).Title, 7)
fullName = ActiveDocument.InlineShapes(i).Title
Do while i < shapesCount
If (combox exists) then
If name = "country"
i = i+1
THIS THREAD HAS EXPIRED.
Are you having the same problem?
We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.