Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 07-10-2014, 06:22 AM
macropod's Avatar
macropod macropod is offline Copy Files to a directory Windows 7 32bit Copy Files to a directory Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,520
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo()
Dim StrOldPath As String, StrNewPath As String, strFile
StrOldPath = ActiveDocument.Path
StrNewPath = Left(StrOldPath, InStrRev(StrOldPath, "\"))
StrOldPath = StrOldPath & "\"
StrNewPath = StrNewPath & "translation to\"
If Dir(StrNewPath, vbDirectory) = "" Then
  MkDir StrNewPath
End If
strFile = Dir(StrOldPath & "*.PDF", vbNormal)
While strFile <> ""
  FileCopy StrOldPath & strFile, StrNewPath & strFile
  Kill StrOldPath & strFile
  strFile = Dir()
Wend
End Sub
To merely copy the files, delete 'Kill StrOldPath & strFile'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
copy files, move files, pdf



Similar Threads
Thread Thread Starter Forum Replies Last Post
copy, sync files across 2 folders 1 pc spgprivate Office 0 06-20-2013 08:41 AM
How to copy linked Excel and Word files and retain links ashleynpeters1 Word 1 05-30-2013 02:25 PM
Alphabetize Directory Moira Windows 1 05-16-2013 03:20 PM
Active Directory ababc Misc 0 09-19-2006 06:18 AM
Active Directory nukkumatti Misc 0 11-16-2005 08:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft