Reply
 
Thread Tools Display Modes
  #1   Report Post  
ronymaxwell ronymaxwell is offline
Junior Member
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom[_3_] Stefan Blom[_3_] is offline
external usenet poster
 
Posts: 6,897
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
content controls versus legacy controls Judy Microsoft Word Help 7 April 22nd 23 06:36 AM
legacy controls vs content controls Judy Microsoft Word Help 2 January 23rd 10 02:01 PM
content controls versus legacy controls Judy Microsoft Word Help 0 January 23rd 10 02:50 AM
legacy controls vs content controls Judy Microsoft Word Help 0 January 23rd 10 01:57 AM
Forms - Controls to Calculate Totals WITHOUT Using Legacy Controls dewaaz Microsoft Word Help 6 January 30th 09 06:53 AM


All times are GMT +1. The time now is 12:12 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"