Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Controls Collection: Order of Controls
I have a large number of image controls in a Word document which are initially set to be hidden to the user (Controlname.Visible = False). According to actions the user takes images become visible. The code for referencing these images relies on the Controls Collection (Application.ActiveDocument.Shapes(1).CanvasItems( i) where i is a particular image). I want to add a couple of images to the document, but I don't want them to be placed at the end of the controls collection as the For..next loop I use to reference them relies on their being in a particular position relative to the others. I need to change the order of the controls in the collection so that I can have the new inages where I want them. The alternative is to laboriously change the images to get the new ones in the places I need them. Is it possible to change the order of the controls collection?
|
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Controls Collection: Order of Controls
You can't control the index numbers for members of a collection. Sometimes, the
largest reference number corresponds to the last collection member, but I wouldn't rely on it... Some objects can be named; I my experience, using the name is the safest way to reference it in a collection. For more on this, you may want to ask in the MSDN Word Developer forum; see http://social.msdn.microsoft.com/For...orddev/threads. -- Stefan Blom Microsoft Word MVP "ronymaxwell" wrote in message ... I have a large number of image controls in a Word document which are initially set to be hidden to the user (Controlname.Visible = False). According to actions the user takes images become visible. The code for referencing these images relies on the Controls Collection (Application.ActiveDocument.Shapes(1).CanvasItems( i) where i is a particular image). I want to add a couple of images to the document, but I don't want them to be placed at the end of the controls collection as the For..next loop I use to reference them relies on their being in a particular position relative to the others. I need to change the order of the controls in the collection so that I can have the new inages where I want them. The alternative is to laboriously change the images to get the new ones in the places I need them. Is it possible to change the order of the controls collection? -- ronymaxwell |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
content controls versus legacy controls | Microsoft Word Help | |||
legacy controls vs content controls | Microsoft Word Help | |||
content controls versus legacy controls | Microsoft Word Help | |||
legacy controls vs content controls | Microsoft Word Help | |||
Forms - Controls to Calculate Totals WITHOUT Using Legacy Controls | Microsoft Word Help |