Ask user to input Doc Shape Data when starting a new document from a template

Started by hill041, August 21, 2018, 08:59:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hill041

Is there a way I can ask the user to enter Document shape data when first starting a document using a custom template? I would like to do this without macros and using shapesheet if possible but if not then its not the end of the world.

I have given the document some user defined shape data cells (eg. Document number, document date, author etc.) and then displayed this info in a number of shapes across the various pages of the document. I've referenced TheDoc! data in the shape cells on each page and set "askondrop" to true in the document shape data but this has not worked as i thought it might.

Thanks in advance.

Yacine

Made some trials with doc formulas. Turned out to be quite difficult to get the right trigger. Also using docmd(1213) asked for data of the page instead of the doc.
Better trigger the process by means of VBA.
Yacine

Surrogate

I make my solution in 2005 where used method like as in video Global Shape Data in Visio Document
Quote from: Yacine on August 21, 2018, 05:57:03 PMAlso using docmd(1213)
Write formula DOCMD(1312) in cell EventDrop in section Events, when you drag master to page you get pop-up shape data window !

hill041

Thanks for the help guys, although I am currently already using DOCMD(1312) for when the user creates an instance of my master shapes. What I really want to do is have the user prompted to enter the "Document number, document date, author etc." as soon as they start a new document from the template file. Any ideas?

Surrogate

Quote from: hill041 on August 22, 2018, 07:05:33 AM
as soon as they start a new document from the template file. Any ideas?
I think you can write macro

hill041

Chris Roth sent the following response on another forum - i hope he doesn't mind me posting it here too!:

"The ShapeSheet expression DOCMD(1312) will pop-up a Shape Data dialog. This is usually attached to Action-row cells, or EventDblClick or EventDrop. Since none of those make sense for the Document's ShapeSheet, we have to come up with some sort of trigger.

It turns out, that if a document is not saved--like when you are first editing a new doc based on a template--then the result of the DIRECTORY() will be an empty string.

So we can test the length of that function's result, and call our DOCMD if it is zero.

So in the Doc ShapeSheet, I've added the User.Trigger_ShapeData cell, as follows:

User.Trigger_ShapeData = IF( LEN( DIRECTORY() ) = 0, DOCMD(1312), 0 )

You can test on a saved .vsdx by browsing to the file from Visio's Open interface, then right-click and choose Open a copy. This is a nice way to simulate starting a new drawing from a template (open a copy, the new drawing has no filename, just like with a template.) But working with templates while you are building something is a pain, because you have to always open the original, which is less-than-easy to do."