Macro needed, Two saves in One

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


0
Jojo (2)
3/26/2007 11:46:58 AM
visio 3638 articles. 1 followers. Follow

3 Replies
743 Views

Similar Articles

[PageSpeed] 47

On Mon, 26 Mar 2007 13:46:58 +0200, "Jojo" <Jojo@Ojo.net> wrote:

>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.


-- 
Regards, Paul Herber, Sandrila Ltd.        http://www.sandrila.co.uk/
0
3/26/2007 4:22:58 PM
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


"Paul Herber" <SubstituteMyFirstNameHere@pherber.com> a �crit dans le 
message de news: bnsf03lcvsb6qhc06tn3441jq33koqsgrg@news.gradwell.net...
> On Mon, 26 Mar 2007 13:46:58 +0200, "Jojo" <Jojo@Ojo.net> wrote:
>
>>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.
>
>
> -- 
> Regards, Paul Herber, Sandrila Ltd.        http://www.sandrila.co.uk/ 


0
Jojo (2)
3/27/2007 6:30:10 AM
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


On Tue, 27 Mar 2007 08:30:10 +0200, "Jojo" <Jojo@Ojo.net> wrote:

>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
>
>
>"Paul Herber" <SubstituteMyFirstNameHere@pherber.com> a �crit dans le 
>message de news: bnsf03lcvsb6qhc06tn3441jq33koqsgrg@news.gradwell.net...
>> On Mon, 26 Mar 2007 13:46:58 +0200, "Jojo" <Jojo@Ojo.net> wrote:
>>
>>>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.
>>
>>
>> -- 
>> Regards, Paul Herber, Sandrila Ltd.        http://www.sandrila.co.uk/ 
>

-- 
Regards, Paul Herber, Sandrila Ltd.
Visio Utilities           http://www.visio-utilities.sandrila.co.uk/
0
3/27/2007 9:05:31 AM
Reply:

Similar Artilces:

Need better way to provision AD accounts that are to have mailboxes
The exchange admins in my company have come up with a way for the sys admins to assign the user's mailbox store location. It's based off of last name. For example, if your last name starts with letter A, you go on Storage Group 1, Mailbox Store A, if your last name starts with letter B, you go on Storage Group 1, Mailbox Store B, if your last name starts with letter E, you go on Storage Group 2, Mailbox Store A, etc.... This is, I believe, and administrative nightmare. Is there a better way to provision AD accounts that are to have mailboxes? If it works for you and them, then al...

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

Exchange fowarding from multiple accounts to one inbox
We have exchange and Win2K server, sending email to client PCs with Outlook. We set up email fowarding in active directory, to let a specific user (call him UserX) check a number of email addresses (eg. user1@company.com, user2@company.com and user3@company.com). These other email addresses are for users who do not have outlook. This works OK. When a message is sent to multiple users at once (eg user1 and user2 in the to: field)) only one email arrives in UserX's Outlook. This one email contains both email addresses in the to: address. Is it possible to receive one message in the inb...

need help with an excel spreadsheet
I have an excel spreadsheet where questions are answered in one area, and the answers show up on a form in another area of the sheet that gets printed. Instead of printing, how can I either email the print area or have just the print area saved as a file? And, with a macro, can the new file be named automatically by what's in a particular cell? Thanks, Russ You don't say whether the recipient would need to edit the data. If not, there are numerous programs available (free, shareware and commercial) which enable print output to be stored as a PDF file. Another option would be to c...

Conditional Formula
Hello, I would like some help in evaluating the value of a cell that falls within a certain range. For example: If A2 is less than 1 and greater than 10 "TRUE" Your help is appreciated. Ed Hi Eduardo do you mean if A2 is less than 1 OR greater than 10??? if so format / conditional formatting formula is =OR($A2<1,$A2>10) or if you mean greater than 1 and less than 10 =AND($B1>1,$B1<10) Cheers JulieD "Eduardo" <Eduardo@discussions.microsoft.com> wrote in message news:00BD63BC-81A8-41B9-86F0-BAE57246B86C@microsoft.com... > Hello, > I would li...

Where do I find "save as..." in MS Office 2007 ?
Sorry, but I did not found "save as..." menu in Office 2007. I only found in the upper left corner a flopy icon which represent a "save" but not a "save as...." So where is "save as..." (with files selction dialog) hidden in Office 2007? Camille Click the Office button (the round "pizza icon" in the upper left corner of the screen) and then click Save As. -- Stefan Blom Microsoft Word MVP "Camille Petersen" <cpet_magnus@hotmail.com> wrote in message news:4baf94cc$0$6768$9b4e6d93@newsspool3.arcor-onlin...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

saving the history of recently used excel documentsto another comp
Reimaging a computer and wanting to know if I can export the excel history to the new image. Most files are on the network and not sure where they are, don't want to remap them all If you're referring to the files listed at the bottom of the File menu you'd have to run the Regedit program and go to this key: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Recent Files replacing the "11.0" with your Excel version if different. Then you would have to right click on the Recent Files folder and Export it. After the reimage you would double-click the resultin...

When changing end time in appointment crm cannot save duration
Hello all When we started running the crm with https instead of http the following error appeared: When you change the end time of an appointment, CRM cannot save the change to duration. Error message: "Microsoft CRM was unable to save the change to duration. Try changing the duration value again." Any ideas? Regards Magnus Also, the error is only surfacing in the web client. /Magnus "Magnus Olsson" wrote: > Hello all > > When we started running the crm with https instead of http the following > error appeared: When you change the end time of an app...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Making a domain appear in two places?
Assumptions: 1. We are running Exchange 2003 (SBS 2003 Server) in our office and are running a Windows domain (not to be confused with an internet domain). 2. We have a domain let's call "domain.com" and it is working for receiving email. Problem: We want to place another Exchange box in our datacenter. The datacenter is completely remote from our office. It runs our production web site. It is its own Windows domain and is NOT trusted. How do I?? 1. We want the Exchange Server at the datacenter to receive all email for "domain.com" 2. We want to have two mailbox...

Is there a formular or format to change 1 to one
Is there a formular or format to change a number "1" into the word "one". Hi Kevin, See: http://www.xldynamic.com/source/xld.xlFAQ0004.html --- Regards, Norman "Kevin" <Kevin@discussions.microsoft.com> wrote in message news:3C099B0B-82F6-44FB-AD72-B0F726256F96@microsoft.com... > Is there a formular or format to change a number "1" into the word "one". See http://www.xldynamic.com/source/xld.xlFAQ0004.html -- HTH RP (remove nothere from the email address if mailing direct) "Kevin" <Kevin@discussions.micro...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

How to Use One PST file on Two Computers?
Hello: I have a desktop machine with a pst file in my Outlook 2003. I would like to copy this pst file to my laptop. How do I synchronize the same file on 2 machines so I won't get duplicate e-mails? I use one premium Yahoo e-mail account and several free Yahoo accounts with YahooPOPs.. Thanks in advance, Spudy Hi Spudy, it is not possible by default to share PST files. A list of a list of third-party synctools are also on this site: http://www.slipstick.com/outlook/sync.htm On the Microsoft Office Marketplace site is a list of third-party messaging tools: http://office.microsoft.com...

Need to set extra hard return
Hi, This must be a very basic thing, but I have been asked to submit a paper with extra hard returns in Word. How do I do this? Can anyone help me out please? Thanks. Viju vijuhegde wrote: > This must be a very basic thing, but I have been asked to submit a > paper with extra hard returns in Word. How do I do this? Can anyone > help me out please? Ask whomever assigned this task to explain this task. Essentially a "hard return" signifies the end of a paragraph. It's simply pressing ENTER. The "soft return" is just a way to start a new line - h...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

How to setup online access to multiple accounts in one institution
I am using Money 2004 Small Business. I have 4 different accounts with Ameritrade, each account has a different online account ID and pin number. Money does not appear to let me setup all four accounts for activity download, it appears to permit only one set of account login info per institution. Is Microsoft short sighted in designing this or I am missing something? Please help, your effort will be greatly appreciated. Matt In microsoft.public.money, Admin wrote: >I am using Money 2004 Small Business. I have 4 different accounts >with Ameritrade, each account has a different onl...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

Sum of Two Union Queries
Hello, I have the following SQL that produces two record totals (as it should). But I want to SUM those two values from within the same query. Rather than create a second query that SUMs the two values from the first query: SELECT Count(*) AS SubCount FROM [MyTable1] WHERE (([MyTable1].UNIQUEUSER)="JOHNSMITH") UNION ALL SELECT Count(*) AS SubCount FROM [MyTable2] WHERE (([MyTable2].SWCASSIGNEDUSER)="JOHNSMITH"); The results I get are: SubCount -------------- 380 2 I've tried "wrapping" that entire SQL code inside of a SELECT SUM, but upon execution it ...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Saving in 2003 Excel
I am currently taking Excel 2002 in college. The software I have loaded is 2003 but my Professor is running 2002. Can someone tell me how ot save in 2003 so the Professor can read in 2002? Hi Terry! Just save normally. You version challenged Professor will be able to open it. -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good homes. Same file format, no problems.. -- Regards, Peo Sjoblom "Terry" <our.email@fuse.net> wrote in message news:384d...

New SBS2008 domain Outlook won't setup on last two devices: suspect firewall
New site almost finished. Office is a bunch of PhD engiineer types that have to fiddle with stuff. Also they all know MS stuff sucks. Last two workstations (Vista and XP) joined to domain fine. Open Outlook 2007 and it stalls and never sets up profile, error must be connected to server to work! Network fully visible. I believe owner has 'tinkered' with sbs2008 firewall during this time. Need pointer on when next to go. Could firewall change stop the setup? TIA Did you create users with wizards did you connect the PC's with http://connnect is the DHCP server th...

transfer investment account from one .mny file to another
Hi, I am using Microsoft Money Plus Home & Business version 17.0.150.1415. I use it to keep track of my personal finances in one .mny file, and I use it to keep track of business finances in another .mny file. In the .mny file for my business, I just created an Investment account and added about ten stocks to it. I should have created this in my personal .mny file. Can anyone tell me if there is a way I can move this one investment account (and the stocks included in it) from my business .mny file to my personal ..mny file? Thanks in advance, Paul -- Paul Kraemer In m...