Code for remanimg files from a field in a table

GoKats78

Board Regular
Joined
Aug 22, 2008
Messages
166
We are changing Document Control system software. Our current system saves the documents with a unique file number; it also strips the file properties. There is a table on the SQL server that lists the unique number, and file type (e.g. Word Doc, Excel). What I need to do is have some code grab the file, rename it based on the doc number and document title found in the table and reassign the file properties.
How difficult of code of this type, and what, in general, would it look like?

As I get more details I will add them so I can get the help I really need!



Well, at least the help with the code...
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi GoKats78,

The code to rename a series of files isn't all that difficult - you could even do that much with a DOS batch file. But what do you mean by "reassign the file properties"?
 
Upvote 0
The software removes the file extension and any other files properties (all those items that are present when you right click and choose "properties")
 
Upvote 0
Hi GoKats78,

OK, what happens if you make a copy of the file and load it onto another system:
Do you have to manually add the extension back on? And once you've done that (assuming that's what's required, don't the other properties re-appear? If not, where are they held so they can be re-assigned?
 
Upvote 0

Forum statistics

Threads
1,225,432
Messages
6,184,956
Members
453,270
Latest member
jgRSLCaUNQtW

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top