Identifying an Object on Multiple Pages

D

Dave

For a Visio file containing multiple pages, I want to automate the
drawing of a text box at a given location on each page, and the
insertion of a field (Insert > Field > Page > Info > Name) in that text
box. The idea is that the resultant macro would repeat the insertion of
that text box / field on the rest of the pages.

So, I record a macro to automate the above by recording performance of
these steps on the first page of the file.

Problem occurs in running the macro on the subsequent pages. I get a
run-time error [-2032465766(86db089a)], "Reqeusted operation is
presently disabled". When I open the debugger, the highlighted line of
code is:

vsoCharacters3.AddFieldEx visFCatPage, visFCodePageName,
visFmtStrNormal, 1033, 0

I'm assuming that Visio is getting stuck trying to identify the text
box objects on the subsequent pages after it has inserted them, since
it is looking for the specific text box inserted on the initial page.
That's just my guess.

How can I instruct Visio to recognize these objects? I'm betting there
is some routine that can be written, or way of tweaking the macro, in
order to get this working.

For the record, no, I don't believe this is a macro security issue,
since I've got the security setting on 'low'.

TIA,
Dave
 
D

David Parker

I suspect that your reference to the shape is incorrect. How are you doing
it?

By the way, why do you not create a master with the desired apperance + text
(inclusing field codes), and just drop the master on each page?
 
C

Chris [Visio MVP]

I'm ot sure exactly what you're doing, but perhaps putting one box on a
background page might save you a lot of trouble. Each page in the document
can use the same background page, so you don't have to keep recreating it.

This might not apply to you, but I thought I'd throw it out there, just in
case.
 
D

Dave

I would like to thank David Parker and Chris Roth for their excellent
responses. Problem solved. Basically, by inserting a background page
and assigning it to each foreground page, we eliminate the need to
include that routine in the first place.

Much appreciated.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top