Macro needed, Two saves in One

J

Jojo

Hi,
I need some help.
I have a Visio page open and I have saved it once already as a VSD file. So
it already has a filename with a aVSD extension.

So I'd like to be able to click a macro button that does this

Application.ActiveDocument.Save

then this

Application.ActiveWindow.Page.Export "C:\Documents and Settings\Visio
Stuff\PNG\SameFileNameAsVisioFileName.png"

i.e. Export the file (keeping the same filename as the VSD name) but as a
PNG in my PNG subfolder .

Any help appreciated.

(Should I move this to a VBA newsgroup ?)

Jojo
 
P

Paul Herber

Hi,
I need some help.
I have a Visio page open and I have saved it once already as a VSD file. So
it already has a filename with a aVSD extension.

So I'd like to be able to click a macro button that does this

Application.ActiveDocument.Save

then this

Application.ActiveWindow.Page.Export "C:\Documents and Settings\Visio
Stuff\PNG\SameFileNameAsVisioFileName.png"

i.e. Export the file (keeping the same filename as the VSD name) but as a
PNG in my PNG subfolder .

Just create a macro and add both lines.
If you record a macro and do the save then it will do the first line
for you.
 
J

Jojo

Yes, Paul.
I know how to record macros.
That's how I obtained the first line.
What I need is that the macro save the PNG file based on the currently
focussed VSD file name.
Your suggestion - apparently - gives me a macro that would save every file
with the same name.


What I want to do is in the title of the post.
The problem is not the first line.
The problem is the second line.
The problem is
grabbing the filename out of the text string and
adding the PNG folder and
zapping the VSD extension and
adding the PNG extension and
confirming that I want to squash the existing filename.PNG.

It's no big deal.
I could spend an hour on it and get it done.
But I have very little time and a deadline.
That's why I'm asking for help.

Jojo
 
P

Paul Herber

Ah, in that case you can get the saved document's name from
ActiveDocument.name and the full path may be obtained from
ActiveDocument.FullName
 

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