Use alternate Pagesheet value when master is dropped onto the page

Started by DJHarris71, March 09, 2018, 08:48:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJHarris71

I have a title block that displays a pagesheet cell called "ThePage!Prop.Title".  Because of this, the master object in my stencil has the "Prop.Title" cell in the pagesheet.

When I drop a title block on a blank page - visio is very helpful in the fact that it creates the pagesheet cell for me - and it will take on the value that is hard coded into the master shape.
Here is where my problem exists.  I have a 'User Defaults' section that give the user the ability to create a custom default title.  The expectation is that when the title block is dropped onto the page the 'users custom default title' is used in place of the masters pagesheet title value.  However - if the user drops a second title block on the page - it needs to not overwrite the title that is on the pagesheet, because the title has already been established.

So the question is:  How can I detect the creation of a pagesheet cell due to shape drop so the code only applies the 'user custom default title' on a drop to a page without this pagesheet cell (e.g. blank page)?

I found the code 'Application.IsInScope(1246)' to detect that it was a drop, but the pagesheet data is already in place by then - which means I can't tell if the drop made the cell or not.

Thanks.

wapperdude

One method would be to have a User cell on the page's shapesheet.  Then, when Title block is dropped, it checks if value is true or false.  If false, it (a) sets new title, and (b) sets the page cell to true.  When subsequent title blocks are dropped, the true value would inhibit updating the page title.  Some of this could be done in shapesheet, but I suspect needs some initial code/mechanism such that this "truth" cell is set to false.

Wapperdude
Visio 2019 Pro

DJHarris71

Thanks for the reply Wapperdude.  I came up with a similar thought.  This is how I will do this.
I set the 'Title' to 'tmpTitle'.  If it sees this is the value it will use change the value to the default.
I have a few other settings that work similarly but are Boolean.  I may use the 'prompt' field for these instead.



wapperdude

Visio 2019 Pro