Wrox Programmer Forums
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 13th, 2011, 07:44 PM
Registered User
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Word VBA file updating

I'm using MS Word 2003:

I have files saved in a folder numbered structure:

OLDFILES/
001/5674.tiff
/5675.tiff
/5676.tiff

002/5677.tiff
/5678.tiff
/5679.tiff

I will receive new versions of these files but in a different folder structure, usually all in one folder but they can also arrive in various folder structures within the "NEWFILES" folder.

NEWFILES/
5674.tiff
5675.tiff
5676.tiff
5677.tiff
5678.tiff
5679.tiff

I'm looking for a routine that would search each file in the "NEWFILES" folder and it's subfolders, and using it's file name, find it's location in the "OLDFILES" folder and subfolders and copy/overwrite the old file with the new file.

Basically, I receive new versions of these files but with a different folder structure so I need to update the old files with the new ones without having to find each one and manually copy and overwrite each file by hand.

The new files will always have the same file name as the old files just different folder structure.

Any help is GREATLY appreciated!
 
Old November 17th, 2011, 08:34 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

Have you tried using the Dir function

http://vbadud.blogspot.com/2006/12/dir-function-in-vba-visual-basic.html
http://vbadud.blogspot.com/.../vba-dir-function-to-get-sub-directories.html

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto run batch file attached to word-Documents/VBA code is required angls Word VBA 3 September 23rd, 2009 06:08 PM
Need help in word VBA Premanshu Word VBA 3 June 26th, 2009 10:04 PM
Adding or updating record using VBA egivler Access VBA 0 August 31st, 2004 11:06 AM
Word VBA sdowen Excel VBA 4 December 3rd, 2003 04:32 PM
VBA Word gcookie79 Excel VBA 1 November 12th, 2003 01:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.