File Dialog Save as in Visio

Started by grubbarb, March 29, 2022, 05:05:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

grubbarb

Hi all,
I am quite new to Visio programming with VBA. I am struggling with following procedure
- creating a new drawing from a Visio template .vstm
- via makro for input of data (name, project number, user) --> working
- makro sends this information to shape data and title block --> working
- next step of the new file should be: opening of file dialog "save as" and giving a filename proposal (combination of date, name, project number...) --> not working, no idea :'(
- without makro (by user): select path and save document

Has anybody ideas, suggestions how to get this piece done? I tried DoCmd, but then I am not able to give the filename.

Thanks and best regards!

Surrogate

Hi!
Visio haven't own native build-in FileDialogs methods which available for VBA.
You can use FileDialogs from Excel or MSComDlg library

grubbarb

Ok, thank you. Thought of something like this... unfortunately  :(.
Do you have an example available how this "workaround" can look like? Or does anybody else?

Surrogate


Paul Herber

Been working away, fingers to the bone ... type type, type ...
Is this any use to anyone?
https://www.paulherber.co.uk/free-visio-addons/#saveas
Free.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visisthebest

Thank you Paul and my god Microsoft, where is Paul's Visio MVP award?!
Visio 2021 Professional

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visisthebest

You deserve one for all your contributions to the Visio ecosystem! :D
Visio 2021 Professional


vojo

may want to add a "save copy"

Would save a copy of the drawing...similar to "save as"  BUT keeps the original drawing as the active drawing
Its a convenient way to make backups and yet any app using this drawing does not have to change file name.

Paul Herber

The problem is that any Save or SaveAs in a Visio format changes the name of the active document.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

wapperdude

As Vojo suggests, having a Save Copy would be a nice, added feature.  It would definitely extend the utility/scope of this effort. 

And yes, Visio does change the name.  So, perhaps a pop-up form inquiring (1) continue working with the copy, or (2) recall previous for additional editing. 
Visio 2019 Pro

vojo

did something similar in Excell.   Essential when all done and ready to exit, you make the original file the active

Something like

Old_FN = <source document>
<do a save as to New_FN>
Set active drawing = Old_FN
exit

vojo

could make copy like this

Old_FN = <source drawing name>
Copy_FN = <source drawing name> || backup or <0001>    //0001 for first copy...0002 2nd....0003 and so on