Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming and deleting files with macros after saving as html

Status
Not open for further replies.

lucasnevant

IS-IT--Management
May 14, 2003
19
ES
Hi and thanks for your response in advance,

I have created a visio diagram with multiple tabs and I have exported them to html. When Visio saves as html, it creates a number of files (images, javascritps, html, etc...). Among those files there are some special files with the following names: xxx_gif_n.gif and xxx_gif_n.html (where "xxx" is the name of the visio file and "n" is a number corresponding the position of the diagram tab. For example, if I have a visio file called "test" with two diagrams (one on the first tab and one on the second one), and save it as html, visio will generate four files (among others):

- test_gif_1.gif (a gif file showing the diagram at the first tab)
- test_gif_1.htm (an html file showing the diagram at the first tab)
- test_gif_2.gif (a gif file showing the diagram at the second tab)
- test_gif_2.htm (an html file showing the diagram at the second tab)

Locating these files is not very intuitive, and as I need to write the instructions to do this, I wonder is there is a way to write a macro that deletes all unnecessary files and renames the xxx_gif_n named files with the name in their corresponding diagram tab.

Thanks in advance,
Lucas
 
The VBA command to delete a file is Kill.
Code:
Kill "c:\myfile.txt"
The VBA command to rename a file is Name
Code:
Name "c:\myfile.txt As "c:\mynewfile.txt"

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top