save as programmatically

B

bp

Hello,
I am using Visio 2003. And I am opening pre-Visio 2003 documents
programmatically. When I save I get prompted with a dialog. How can I stop
this? I am doig this programmatically. Why would it be prompting me.
Looking at the object browser I see...
Save, SaveAs, SaveAsEx. But none seem to have the values I would need.
Even SaveAsEx only has these options:
visSaveAsRO
&H1
The document is saved as read-only.

visSaveAsWS
&H2
The current workspace is saved with the file.

visSaveAsListInMRU
&H4
The document is included in the Most Recently Used (MRU) list. By default,
Save and SaveAs do not place the document into the MRU list.


can anyone help?

thanks
 
A

Al Edlund

found in help
al

Determines whether Microsoft Office Visio shows alerts and modal dialog
boxes to the user.

intRet = object.AlertResponse

object.AlertResponse = intExpression

intRet Integer. Zero (0) to display alerts to the user and allow the
user to respond, or the value of the default response (see Remarks).

object Required. An expression that returns an Application object.

intExpression Required Integer. Zero (0) to display alerts to the
user and allow the user to respond, or the value of the default response to
supply (see Remarks).



Version added
4.1

Remarks
Certain operations, such as closing a document that has unsaved
modifications, cause Visio to display an alert or modal dialog box
requesting the user to supply a response such as OK, Yes, No, or Cancel. To
prevent Visio from displaying an alert or modal dialog box when a program
performs such an action, set the AlertResponse property to a default value
for the response. In this case, Visio does not display the alert or modal
dialog box; instead, Visio behaves as if the user responded to the alert or
modal dialog box with the value of the AlertResponse property.

If the AlertResponse property is 0 (its default value), alerts and modal
dialog boxes are displayed.

The values you supply for the AlertResponse property correspond to the
standard Windows constants IDOK, IDCANCEL, and so forth.
 
J

JuneTheSecond

I tested next code, but no prompt returned, i wonder why your Visio returns.
ActiveDocument.SaveAs "TestSaveAs.vsd"
Debug.Print ActiveDocument.FullName
 
B

bp

thanks for the help

did you ever try this out?
I opened visio 2003. saved as visio 2002. then in vba put this code:

Dim x As Visio.Document
Set x = Visio.ActiveDocument
x.Application.AlertResponse = 1
x.Save

but I get a run time error.
I tried all the Windows constants.
IDYES
6


IDOK
1


IDIGNORE
5



all gave an error.
i tried google-ing Windows constants and "current visio format"
nothing.
 
B

bp

If you have visio 2003. create a vsd. asve as visio 2002.
then in code try this

Dim x As Visio.Document
Set x = Visio.ActiveDocument
x.Save

you should see a prompt to save as 2003 format
 
J

JuneTheSecond

At first you should specify the name of drawing, so you cannot use save
method first. try next. x.save next to the save_as would not return message.

Dim x As Visio.Document
Set x = Visio.ActiveDocument
x.SaveAs "TestSaveAs.vsd"
Debug.Print x.FullName
x.Save
Debug.Print x.FullName

--
JuneTheSecond



bp said:
If you have visio 2003. create a vsd. asve as visio 2002.
then in code try this

Dim x As Visio.Document
Set x = Visio.ActiveDocument
x.Save

you should see a prompt to save as 2003 format
 

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