Change Title of Document via VBA

Started by metuemre, September 26, 2016, 07:44:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

metuemre

Hi friends,

Is it possible to change the title of the document via VBA? Please see attached picture.

I'm trying to change document's title based on a boolean variable.

If variable is True then title will be "Sample.vsdm - Visio Professional - In Simulation Mode", else, title will be "Sample.vsdm - Visio Professional - In Design Mode".

The only way I know is to save as the document with new name via vba but I don't like that solution. Without changing the document's name, I just want to change the string in the Title.

Thanks in advance.

Surrogate


metuemre

Damn! I need to look for an alternative way then.

Thanks Surrogate.

wapperdude

#3
Is the idea to have the "sample" as a read-only document, to prevent accidental editting, and then by deliberate action allow the user to edit the drawing and do a "save as"?  You ought to be able to achieve something like the behavior you want by creating a template file...only the "title" won't change as desired.

Wapperdude
Visio 2019 Pro

metuemre

The idea is to show the user if the simulation is in progress or stopped. In my custom ribbon there are two buttons to start and stop the simulation as you can see in attached pictures.

If the user press the Stop button group name changes to Simulation-Stopped. If the Start button is pressed group name changes to Simulation-Running.

I thought that showing the Simulation status on the title bar would be better but its not a big deal.

Thanks

wapperdude

Yes, simulation running is important piece of info.  You might use your timer event to blink the background color of the textbox indicating simulation in progress.  Just a thought.

Wapperdude
Visio 2019 Pro

metuemre

I think there is no option to set background color for Ribbon elements. Maybe a transparent image can be used but I prefer to keep the design as simple as possible  :)

Thanks