Change Drawing Name in Shapesheet

Started by drewdb, August 08, 2008, 11:08:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

drewdb

Hi to all,

Here is what I have:

I have put together a template that allows us to easily put together a schematic for the Audio Visual industry. It has a border with the drawing info at the bottom. The shape data pops up when a user drops a border on the form and they can enter the job name, drawn by etc.

Here is what I would like to do:

Have the border shape change the name of the drawing (eg: Drawing1 "Document Workshape Name) to the Job Name that was entered and I believe that this would show when the user goes to save the new drawing.

Is there a formula that allows this to happen.

Thank you.

Visio Guy

Hi Drew,

Unfortunately, the page's name is not controlled by the ShapeSheet. Yes, shapes and ShapeSheet cells can get a page name using the PAGENAME() function, but you can't push or set the page's name without using code.

It sounds like you have a fairly nifty ShapeSheet-only solution, and it might muddy the waters if you had to introduce code to get this done. But let us know.

An "almost-hack" can get the Page Setup dialog to pop-up, but this requires the user to select the Page Properties tab in order to change the page name. The ShapeSheet function: DOCMD(1076) will cause the Page Setup dialog to appear. You can use this in the EventDrop cell, the EventDblClick cell, or in an Action cell.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

drewdb

#2
Thank you for your quick response.

I've tried to keep it just to the shape sheet to avoid the macro warning.

How would i do it as a vba and also, is there a way to stop the macro warning or does the user have to change their security setting? I'm guessing the last.

It would be a small price to pay for me to be able to set the workspace name off the info that the user enters when they drop the border shape. This will help me to manage naming in my directory structure.

I have also written a C# app that produces a BOM from the drawing and this would make it a lot easier.

Thanks again.

wapperdude

At the risk of being completely out in left field, perhaps not even in the ballpark, but you might approach the problem from the opposite direction.  The background page title block can be set to read either the page name, file name, you name it (no pun intended) using the (toolbar)>Insert>Field dialog.  So, instead of the background page driving the drawing name, do it the opposite direction.  Either when a page is added or re-named, or the file name when it is saved.  Just a thought.
Visio 2019 Pro

drewdb

Thanks for your reply,

I need to be able to drive it from the shapesheet (or VBA) to change the "Drawing1" to a "job name". When the user selects "Save" it will have the new "job name.vsd" in the save dialog box instead of "Drawing1.vsd" and the user can just press save without having to name the file. This way i can hope to control the naming conventions a bit better. Hopefully :)

wapperdude

I was just trying to open up alternative considerations.  My thought was, at some point, the user has to provide a name.  That name can go into "the job title field" and then flush thru to the page and file names.  Certainly that's more efficient.  But, the user could just save the file with the job name, and let that flush into the title field.  There's still the problem of the drawing page name.  As I said, it was a really long shot, and you've already considered the issue.  Hopefully, additional inputs will come from the forum.
Visio 2019 Pro

drewdb

No Please, I thank you for your input.

I must admit that with my limited knowledge of Visio (2 weeks), i wasn't quite sure what you meant.

The way you put it now it does make sense. I only want the user to enter the job details once so that we don't end up with multiple names and spelling and such.

I will head in this direction with my research on exactly how to achieve this.

Thanks again.

wapperdude

Yeah, I was afraid I didn't explain it too well.  Your original approach is more "natural", more logical, and, overall, cleaner to enter all the data at one time...at that point in time.  Using the file name, for example, to fetch the drawing name, seems weird, that's why I put a lot of "disclaimers" on it.  It probably will work, but, will people accept it? 
Visio 2019 Pro

vojo

2 weeks in...this may scare you but:

Option 1:   
               - Create a template that you use for all jobs
               - User opens the template and saves as desired
               - page (background or foreground) uses doc name (shapesheet fcn) to create footer
                     - put in user cell
                     - have insert name process (no VBA) on drawing
               - other info as well...date or version...done similar to the user cell/input name

Option 2:
               - drawing or template...your choice...user saves as new job file
               - first page of foreground....have a shape (square or cool icon for your company)
               - shape has custom propertieis
                      - job name, date, version, whatever
               - second thru N pages (foreground or background)
                      - insert custm propertieis from 1st page as needed.

As a sidebar...it would be great in general if VISIO provided a method/mode to save drawing pages in a
"database"  ie peruse (sp) the database looking for the drawing of interest...1 page 1 entry.   This way when doing lots of drawings in different contexts, it would be easier to find/leverage previous work instead of relying on user's memory to recall that he/she did a similar drawing 3 months ago for a different context
(different customer or slightly different agenda/goal).

Anyway...good luck

drewdb

Thanks all,

Some of everything makes sense.

As you stated, if i put a field for the "Doc Info - Filename" this will initially have "Drawing1.vsd" and when the user saves the doc it probably doesn't matter if they spell the job name differently from the drawing job name label because the print of the drawing will have what every they saved it as on it.

This will be easy for me to manage from a works flow point of view. Users will be able to find the file regarless of the job name.

It still would be better from the users point of view to be able to enter the job name once and be done with it. All spelling being correct or incorrect would be the same. Great to wish.

I have learnt a lot in the last two weeks thanks to this site and all of you.

Hopefully i can return the favour at some stage :)

ben.oates

This might be miles away from a desired response but Visio might not be the ideal tool. Have you seen InfoPath? You can put details in the form in InfoPath and the form will submit itself to a pre-determined location with a developer set file name. If you've got SharePoint it can also publicise developer selected information to the list so you can search on these fields. You can attach files in forms and add bits of snazzy workflow management.

Fun & games.

aledlund

as a note from the side.
There is a demo on msdn that used to put the job/project into the page sheet and shown on the pagesheet with vba code. A documentsheet shouldn't be any different.

http://msdn.microsoft.com/en-us/library/aa140253(office.10).aspx

regarding vojo's desire for a place 'to store', several years ago I used to save the MS documents in Access (since it can store objects) then I had a simple form that could pull them up. I used it for most everything (Project, Visio, PPT, Lotus files).

al