VBA code to select a shape that's in the same place on every page?

Started by lloydburton619, October 17, 2014, 08:05:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lloydburton619

I have some code that generates a simple contents page for my Visio document based on the page names, however on each page I have a box with a unique number for each, located at the same location on each page; I want that number to appear in the contents page for each entry.

I think I can do everything apart from the bit that selects the box with the number in... how do I tell the code which box to select?

(New to VBA, have only learnt it through examples)

Thank you.

Yacine

Two possibilities:
1) you find a way to recognise the shape by some custom field or shape data, iterate through all the shapes of the page to find it, then do whatever you need with it.
2) instead of putting the unique number in a shape, put it in a custom property of the page. So retrieving this value would be easy (thepage!prop.uniqueNumber). Displaying this number would be as easy too, by inserting this value in the according shape.

HTH
Yacine