Background Page to Reference Foreground

Started by Joe7712, September 05, 2014, 09:44:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe7712

Hello,

Is it possible for a shape in the background page to reference a custom property of the foreground page where it is being used (In the same way that is is possible to retrieve the page number with PAGENUMBER() and page title with PAGENAME())

For example to include the foreground's page custom drawing number (stored in a user cell on the page) on a generic diagram frame being used in the background.

I have looked at trying to use a combination of EVALTEXT or EVALCELL with the page number to retrieve the property but not had any luck so far...

Jumpy

Never tried this and fear it won't work:

User Pagename() in the PageSheet of the Background-Page, for example in User.FrontPageName.
In the Shape sth. like =Pages[EvalText(ThePage!User.FrontPageName)]!PageSheet!User.YourCell

Don't now if the second step is aloowed. Eventually you can use SETF to set this formula new everytime yu change pages using Dependson?

User.SetFormula =DEPENDSON(ThePage!User.FrontPageName)+SETF(GetRef(User.MyLocalCell),"=Pages["&EvalText(ThePage!User.FrontPageName)&"]!PageSheet!User.YourCell")

Yacine

I think having seen this same question in the forum some while ago.
There has been a long discussion about it.
Sure you can find it.
Yacine

wapperdude

Yes, it can be done.  In the shape on the background page, insert a field something like:  =pages[page-1]!sheet.1!User.MyTxt  where you've named the User row to be MyTxt..

See attached example.

Wapperdude
Visio 2019 Pro

Yacine

#4
Hi Joe,
so I had some time to look at your problem.

It is fact that you cannot reference non-specific page properties on a background page.

Beside page number, number of pages and background, there is only the page name that can be referenced.

Now the funny thing is, that PAGENAME() can be used with text functions. eg instead of just inserting PAGENAME() you can use parts of it. Like Left(PAGENAME(),1), MID(PAGENAME(),2,3) and similar.

If you now go only one step further, you could imagine inserting in a background shape a formula like =INDEX(2,PAGENAME()), where the page name would be a semi-colon separated list (eg. "Page-1;For internal use; Floor 1"). This background shape would then display "Floor 1".

Now you may either edit manually the page name, or set it up by means of a small macro that would collect the values of the custom properties of the page and concatenate them in a semicolon separated list.

Please find enclosed an example demonstrating my explanation.

HTH,
Yacine

PS: I did only find one link and it did not really answer the question: http://visguy.com/vgforum/index.php?topic=1717.msg7510#msg7510
Yacine

Yacine

@Jumpy, I always wonder how you can answer questions from memory only.
I'd love to see you solution in an example.
Can you send one?
Yacine

wapperdude

@Yacine, @Jumpy:  I don't think the post is about grabbing pagenumber info, it's about a custom property on the page...which I interpreted as being stored in a shape as either a User cell entry or possibly a data (prop.xxx) entry.  Both of which are retrievable.

Wapperdude
Visio 2019 Pro

Yacine

#7
Hi Wayne,
you may be right, but Joe wrote
Quote(In the same way that is is possible to retrieve the page number with PAGENUMBER() and page title with PAGENAME())

As this is much more challenging, I concentrated on this aspect. Please check my upload.

If on the other hand it is just a matter of drawing number, then best is to implement it directly on the background page. There's no need to make it more complicated than necessary.

Cheers,
Y.
Yacine

wapperdude

#8
Just making sure that Joe understands we're addressing two different issues.

Not sure, but, this might be the topic you originally had in mind.  Somewhat related to this topic.  It deals with off page connectors and showing the name of the target page:   page name in different page   http://visguy.com/vgforum/index.php?topic=5518.msg22083#msg22083
Visio 2019 Pro

Joe7712

Thanks for all of the responses, just to clarify I was looking at a solution that would a display a custom property of the foreground page in the "background" (using a single background page). So each foreground page would have a User.MyTxt property with a different value, that would be displayed in the background.

Yacine's solution of using the page name to hold the additional information seems to be the best fit so far using =INDEX(2,PAGENAME())

Not been able to get Jumpy's solution to work.

AndyW

You could catch the WindowTurnedToPage event and transfer your data from the foreground page to your shape. I use this event to share a background page across several foreground pages and resize a shape to match the foreground page size.
Live life with an open mind

Joe7712

Slight alternative to Yacine's solution using the page number and a single list of parameters stored in the background page attached to this post.

Yacine

Nice job, but one shouldn't change the page order ;)
Yacine