"Save as" Dialog rather then InputBox

M

Michael

Help... I am using the following code to prompt the user for a filename to
save the custom properties in XML format:

Dim Message, Title, Default, MyValue
Message = "Enter a file name to generate the XML Definitions"
Title = "Demo InputBox"
Default = "D:\Visio\customprop.xml"
MyFile = InputBox(Message, Title, Default)
If MyFile = "" Then End

What I really want is to open something like the "Save As" dialog, so the
user can select an existing file or type a new
file name. What I want back is the full qualified filename the user selected
or entered...

Can this be done in Visio VBA (I am using 2000)

TIA
 
A

al

you might consider something like this

Public Sub SaveAsViaDialogue()
Dim docObj As Visio.Document
Set docObj = Visio.ActiveDocument
Visio.Application.DoCmd (visCmdFileSaveAs)
End Sub
 
M

Michael

I'll give it a try, but this looks like it will save the visio document
itself?
I want to save the generated information (nothing to do with visio format)
in a different file for processing in another application and
want the user to be able to set the filename either by selecting or entering
a new new.
 
A

al

you're correct it does save the visio document. You can of
course write your own dialogue for save as and vba has
mechanisms like 'application.filesearch' to aid in getting
some of the information you will need to fill in the
information.
al
 
A

al

one other thought, have you considered looking at common
controls (Microsoft Common Dialog Control - commdlg32.ocx)?
al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top